{ "id": "154199", "key": "TIMOB-20428", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2016-01-09T12:04:33.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:55.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Error: error calling getLength() on (null) NamedNodeMap\r\n\r\nCode:\r\n\r\n\tself.getElementId = function(oElem) {\r\n\t\tvar attrs = oElem.getAttributes();\r\n\t\tif(attrs != null){\r\n\t\t\t\tfor (var k = attrs.length - 1; k >= 0; k--) {\r\n\t\t\t\t\tvar attr = attrs.item(k);\r\n\t\t\t\t\tlog(\"attribute name: %s, attribute value: %s\", attr.name, attr.value);\r\n\t\t\t\t\tif(attr.name === \"id\"){\r\n\t\t\t\t\t\treturn attr.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\nfor (var k = attrs.length - 1; k >= 0; k--) { ==> this line cause the trouble\r\n", "attachment": [], "flagged": false, "summary": "Even if the xml node attributes from Titanium.XML.Entity.getAttributes( ) is not null, calling length on it cause an exception ", "creator": { "name": "kenjorai", "key": "kenjorai", "displayName": "Kai Lu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kenjorai", "key": "kenjorai", "displayName": "Kai Lu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android, Ti 5.1.1SDK", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }