{ "id": "171591", "key": "TIMOB-26010", "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": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-03T14:19:15.000+0000", "created": "2018-05-01T17:57:26.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "exception", "httpclient" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-06-20T16:55:07.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Calling {code}http.getResponseHeader(){code} throws an exception:\r\n\r\n{code}\r\n[WARN] W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.Map.isEmpty()' on a null object reference\r\n[WARN] W/System.err: \tat ti.modules.titanium.network.TiHTTPClient.getResponseHeader(TiHTTPClient.java:716)\r\n[WARN] W/System.err: \tat ti.modules.titanium.network.HTTPClientProxy.getResponseHeader(HTTPClientProxy.java:135)\r\n[WARN] W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)\r\n[WARN] W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:75)\r\n[WARN] W/System.err: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1200)\r\n[WARN] W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[WARN] W/System.err: \tat android.os.Looper.loop(Looper.java:154)\r\n[WARN] W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:6186)\r\n[WARN] W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] W/System.err: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)\r\n[WARN] W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)\r\n{code}\r\n\r\nI was trying to send some data to sentry.io, maybe inside the response there were no headers.", "attachment": [], "flagged": false, "summary": "Android: TiHTTPClient getResponseHeader throws a NullPointerException", "creator": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti SDK: 7.1.0.GA\r\nOS: macOS High Sierra\r\nTested on: Android 7", "closedSprints": [ { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437274", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This looks valid! Lets add a null check for this scenario.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-02T05:55:44.000+0000", "updated": "2018-05-02T05:55:44.000+0000" }, { "id": "437324", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~Andrea.Vitale], Thanks for sharing with us. Please create a full reproducible test code and provide here for us to test the issue. Did you get same error in all android devices? Thanks.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-05-03T06:40:19.000+0000", "updated": "2018-05-03T06:40:19.000+0000" }, { "id": "437338", "author": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi, a check is really simple: make a request to a server that doesn't append any response header (like sentry.io) and the exception is thrown.\r\n\r\nI created a PR to simply add a null check: https://github.com/appcelerator/titanium_mobile/pull/10025", "updateAuthor": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-03T13:35:24.000+0000", "updated": "2018-05-03T13:35:37.000+0000" }, { "id": "438567", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix is present in SDK 7.3.0.v20180618182516.\r\n\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-20T16:54:59.000+0000", "updated": "2018-06-20T16:54:59.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }