{ "id": "78220", "key": "AC-3007", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-08-11T04:33:53.000+0000", "created": "2011-07-26T09:43:00.000+0000", "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "tguntharp", "key": "tguntharp", "displayName": "Tony Guntharp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:48:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "If you have a XML node, and request a non exiting attribute, Titanium Mobile crashes on Android with NullPointerException\r\n\r\n{code:lang=javascript}\r\nvar node = # XML node\r\nnode.attributes.getNamedItem('foo') // <-- crash\r\n{code}\r\n\r\nThe reason is that on this line\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/xml/src/ti/modules/titanium/xml/NamedNodeMapProxy.java#L31\r\n\r\nyou pass null to the getNodeProxy if the name doesn't exist. Then the getNodeProxy tries to call a method on it\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/xml/src/ti/modules/titanium/xml/NodeProxy.java#L59\r\n\r\nwhich causes the null pointer exception", "attachment": [], "flagged": false, "summary": "Ti.XML getNamedItem on a non existing attribute throws NullPointerException on Android", "creator": { "name": "rubenfonseca", "key": "rubenfonseca", "displayName": "Ruben Fonseca", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rubenfonseca", "key": "rubenfonseca", "displayName": "Ruben Fonseca", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "1.7.2, OS X, Android", "comment": { "comments": [ { "id": "162378", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Ruben\r\n\r\nAre you able to please provide an XML file to test this with, so the core devs have everything they need to replicate it as you see it? This will also allow them to confirm their fix works correctly.\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-10T02:56:22.000+0000", "updated": "2011-08-10T02:56:22.000+0000" }, { "id": "162391", "author": { "name": "rubenfonseca", "key": "rubenfonseca", "displayName": "Ruben Fonseca", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Paul.\r\n\r\nI think the bug got fixed by this ticket TIMOB-4573, specifically on this commit\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/commit/6bcd738ce0719847c20fa4c01b26fdbe7603525a\r\n\r\nSo I think you can close this ticket now. Thank you.", "updateAuthor": { "name": "rubenfonseca", "key": "rubenfonseca", "displayName": "Ruben Fonseca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-10T09:35:51.000+0000", "updated": "2011-08-10T09:35:51.000+0000" }, { "id": "162554", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "That's good of you to provide a follow-up. Closing, as per your request. Cheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-11T04:33:53.000+0000", "updated": "2011-08-11T04:33:53.000+0000" }, { "id": "168255", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Closing due to inactivity.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-10-07T05:48:06.000+0000", "updated": "2011-10-07T05:48:06.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }