Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#8949 closed defect (fixed) null property error

Reported by: dustint Owned by: Kris Zyp
Priority: high Milestone: 1.4
Component: DojoX Data Version: 1.3.0b3
Keywords: dojox servicestore Cc:
Blocked By: Blocking:


There is a problem with the _processResults (line 229 of ServiceStore?.js) function in the dojox service store. Consider the following example: We have a json object passed from the server as follows:

{'foo': 'bar',

'description: null}

_processResults is recursively called on each attribute of our Json object, however, when _processResults is called on NULL the application errors out because results is null in the recursive call (and we try to get the length of NULL).

I propose that we check to make sure that the results[i] is not null before calling _processResults recursively.


for (var i in results){

results[i] = this._processResults(results[i], deferred).items;



for (var i in results){

if(results[i] != null){

results[i] = this._processResults(results[i], deferred).items;



(Notice we don't need an else branch because we are simply writing back to the original object)

This is a problem in 1.2.3 and I still see it present in the trunk.

Change History (4)

comment:1 Changed 13 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to kriszyp

comment:2 Changed 13 years ago by Jared Jurkiewicz

Owner: changed from kriszyp to Kris Zyp

comment:3 Changed 13 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [18462]) Properly handle a top level null value in ServiceStore?._processResults, fixes #8949

comment:4 Changed 13 years ago by Adam Peller

Milestone: tbd1.4
Note: See TracTickets for help on using tickets.