[TIMOB-5112] iOS: Throws NullPointerException when tag not found
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-13T02:36:40.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Release 2.1.0 |
Components | iOS |
Labels | core, module_xml, nullpointer, qe-testadded |
Reporter | Jon Alter |
Assignee | Neeraj Gupta |
Created | 2011-08-25T10:54:42.000+0000 |
Updated | 2013-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
Fixed in master (2.1.0.848d711). Likely resolved during the XML rewrite.
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
Re-opening to edit label
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5039