#8949 closed defect (fixed)
dojox.data.ServiceStore 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: |
Description
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.
BEFORE:
for (var i in results){
results[i] = this._processResults(results[i], deferred).items;
}
AFTER:
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 11 years ago by
Owner: | changed from Jared Jurkiewicz to kriszyp |
---|
comment:2 Changed 11 years ago by
Owner: | changed from kriszyp to Kris Zyp |
---|
comment:3 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.4 |
---|
(In [18462]) Properly handle a top level null value in ServiceStore?._processResults, fixes #8949