Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4707] Android: XML Document.getElementById(id) causes NPE if id doesn't exist

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-07-27T10:05:05.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-30, Release 1.8.0
ComponentsAndroid
Labelsparity
ReporterBill Dawson
AssigneeBill Dawson
Created2011-07-18T12:17:00.000+0000
Updated2011-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.

Comments

  1. Bill Dawson 2011-07-26

    Pull request ready https://github.com/appcelerator/titanium_mobile/pull/283
  2. Don Thorp 2011-07-27

    Code reviewed tested with drillbit closing other related tickets.
  3. Natalie Huynh 2011-08-26

    Tested Drillbit XML with: version=1.8.0 timestamp=08/26/11 14:21 githash=0e2031e Android Emulator 2.1 and 3.2

JSON Source