Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5112] iOS: Throws NullPointerException when tag not found

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-13T02:36:40.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sRelease 2.1.0
ComponentsiOS
Labelscore, module_xml, nullpointer, qe-testadded
ReporterJon Alter
AssigneeNeeraj Gupta
Created2011-08-25T10:54:42.000+0000
Updated2013-12-10T06:03:44.000+0000

Description

Test fails on iOS while using simple following test case: var win = Titanium.UI.createWindow({ title:'window' }); var xmlString = ""; var doc = Ti.XML.parseString(xmlString); var elem = doc.getElementsByTagName("mickey").item(0); win.open(); Error is pasted below and also screenshot of the error is attached. Following is the error: [DEBUG] loading: /Users/vsingh/Library/Application Support/iPhone Simulator/4.3.2/Applications/5C91A3FF-5977-4666-95E8-89A2BA7B2625/QTS.app/atestList.js, resource: atestList_js [DEBUG] loading: /Users/vsingh/Library/Application Support/iPhone Simulator/4.3.2/Applications/5C91A3FF-5977-4666-95E8-89A2BA7B2625/QTS.app/tests/ios/2968.js, resource: tests/ios/2968_js [DEBUG] loading: /Users/vsingh/Library/Application Support/iPhone Simulator/4.3.2/Applications/5C91A3FF-5977-4666-95E8-89A2BA7B2625/QTS.app/tests/xplat/3464.js, resource: tests/xplat/3464_js [ERROR] Script Error = Result of expression 'doc.getElementsByTagName("mickey")' [null] is not an object. at 3464.js (line 1).

Attachments

FileDateSize
Screen Shot 2011-08-24 at 11.13.40 AM (2).png2011-08-25T10:54:42.000+00002983794

Comments

  1. Stephen Tramer 2012-05-03

    Fixed in master (2.1.0.848d711). Likely resolved during the XML rewrite.
  2. Michael Pettiford 2012-06-23

    Closing issue Tested with Ti Studio build 2.1.0.201206211609 Ti Mobile SDK 2.1.0.v20120622174154 hash rdc9dfbe5 OSX Lion 10.7.3 iPhone 4S OS 5.1 Verified expected behavior is shown
  3. Shyam Bhadauria 2012-07-13

    Re-opening to edit label
  4. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5039

JSON Source