Opened 12 years ago
Closed 12 years ago
#9738 closed defect (fixed)
CsvStore dies unless there are data rows
Reported by: | Stefan Bird | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Data | Version: | 1.3.2 |
Keywords: | CsvStore | Cc: | |
Blocked By: | Blocking: |
Description
Currently, CsvStore? doesn't handle CSV files where there is a header row, but no data rows. Eg:
"Country","Capital City","Population"
This is because of the code on line 325: http://bugs.dojotoolkit.org/browser/dojox/trunk/data/CsvStore.js?rev=19903#L325
It does an unnecessary check on the length of arrayOfAllItems. If it is 0, items remains null, as set on line 293. The null is then passed to SimpleFetch?._fetchHandler, which breaks when it tries to access the length property (line 49).
Fix: Remove the unnecessary if statement on line 325. This will cause an empty array to be given to _fetchHandler, which is the expected behaviour since no data rows were returned by the server.
Attachments (1)
Change History (4)
comment:1 Changed 12 years ago by
Milestone: | tbd → 1.4 |
---|
Changed 12 years ago by
Attachment: | CsvStore.patch added |
---|
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch + tests