[TIMOB-4707] Android: XML Document.getElementById(id) causes NPE if id doesn't exist
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-07-27T10:05:05.000+0000 |
| Affected Version/s | Release 1.8.0 |
| Fix Version/s | Sprint 2011-30, Release 1.8.0 |
| Components | Android |
| Labels | parity |
| Reporter | Bill Dawson |
| Assignee | Bill Dawson |
| Created | 2011-07-18T12:17:00.000+0000 |
| Updated | 2011-08-26T15:37:53.000+0000 |
Description
Failcase app.js:
var doc = Ti.XML.parseString("<a/>");
var elem = doc.getElementById("no_such_thing"); // NPE
According to spec (http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document) passing getElementById an ID that does not exist should result in null being returned.
Pull request ready https://github.com/appcelerator/titanium_mobile/pull/283
Code reviewed tested with drillbit closing other related tickets.
Tested Drillbit XML with: version=1.8.0 timestamp=08/26/11 14:21 githash=0e2031e Android Emulator 2.1 and 3.2