{ "id": "116674", "key": "TIMOB-14521", "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": "15703", "description": "2013 Sprint 22", "name": "2013 Sprint 22", "archived": true, "released": true, "releaseDate": "2013-11-01" }, { "id": "15704", "description": "2013 Sprint 22 API", "name": "2013 Sprint 22 API", "archived": true, "released": true, "releaseDate": "2013-11-01" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-10-30T21:27:16.000+0000", "created": "2013-06-30T03:08:47.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "database", "regression", "resultset", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2013-11-16T09:23:49.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": "*Problem*\r\nReading a null value from a resultset causes a NullPointer Exception\r\n\r\n*Test case*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar db = Ti.Database.open('testDB');\r\n\r\ndb.execute('CREATE TABLE IF NOT EXISTS test(name TEXT, captured INTEGERL);');\r\ndb.execute('INSERT INTO test (name, captured) VALUES (?,?)', \"111\", 222);\r\ndb.execute('INSERT INTO test (name, captured) VALUES (?,?)', null, null);\r\n\r\nvar results = db.execute('SELECT name, captured FROM test');\r\nwhile (results.isValidRow()) {\r\n\tvar name = results.field(0);\r\n\tvar captured = results.fieldByName('captured');\r\n\tTi.API.info(name + ' ' + captured);\r\n\tresults.next();\r\n}\r\nresults.close();\r\ndb.close();\r\n{code}\r\n\r\n*Log*\r\n{code}\r\nE/TiResultSet(32758): (KrollRuntimeThread) [4,1124] Exception getting value for column 7: null\r\nE/TiResultSet(32758): java.lang.NullPointerException\r\nE/TiResultSet(32758): \tat java.io.ByteArrayInputStream.(ByteArrayInputStream.java:58)\r\nE/TiResultSet(32758): \tat org.appcelerator.titanium.TiBlob.getInputStream(TiBlob.java:319)\r\nE/TiResultSet(32758): \tat org.appcelerator.titanium.TiBlob.guessContentTypeFromStream(TiBlob.java:193)\r\nE/TiResultSet(32758): \tat org.appcelerator.titanium.TiBlob.loadBitmapInfo(TiBlob.java:209)\r\nE/TiResultSet(32758): \tat org.appcelerator.titanium.TiBlob.blobFromData(TiBlob.java:182)\r\nE/TiResultSet(32758): \tat org.appcelerator.titanium.TiBlob.blobFromData(TiBlob.java:165)\r\nE/TiResultSet(32758): \tat ti.modules.titanium.database.TiResultSetProxy.internalGetField(TiResultSetProxy.java:113)\r\nE/TiResultSet(32758): \tat ti.modules.titanium.database.TiResultSetProxy.internalGetField(TiResultSetProxy.java:92)\r\nE/TiResultSet(32758): \tat ti.modules.titanium.database.TiResultSetProxy.field(TiResultSetProxy.java:64)\r\nE/TiResultSet(32758): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\nE/TiResultSet(32758): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159)\r\nE/TiResultSet(32758): \tat org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)\r\nE/TiResultSet(32758): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185)\r\nE/TiResultSet(32758): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/TiResultSet(32758): \tat android.os.Looper.loop(Looper.java:130)\r\nE/TiResultSet(32758): \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n{code}\r\n\r\n*Additional details*\r\nA DB to get it reproduced can be the one available [here|https://github.com/appcelerator/KitchenSink/blob/master/Resources/etc/testdb.db] (table will be created if not exists).", "attachment": [], "flagged": false, "summary": "Android: Reading NULL value from database causes java exception", "creator": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "environment": "Android 2.3.3\r\nTi SDK 3.2.0v20130629180316", "comment": { "comments": [ { "id": "260882", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi,\nCan you please post a runnable sample code to reproduce the issue?\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-05T07:12:09.000+0000", "updated": "2013-07-05T07:12:09.000+0000" }, { "id": "261357", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "[Moved to description]", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-10T23:00:05.000+0000", "updated": "2013-07-10T23:41:58.000+0000" }, { "id": "264916", "author": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "body": "The issue cannot reproduce with the release master 3.2.0\nTested with: \nTitanium SDK version: 3.2.0\nTested on\nDevice: Samsung galaxy s duos Android version: 4.0.4", "updateAuthor": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-05T10:33:29.000+0000", "updated": "2013-08-05T10:33:29.000+0000" }, { "id": "265270", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "As per the \"Environment\" section. Please test with a Gingerbread (2.x) device. The problem is strictly with Gingerbread.", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-07T00:50:09.000+0000", "updated": "2013-08-07T00:50:09.000+0000" }, { "id": "270216", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "I hope this gets looked at soon, as the result of these NPE causes the app to be really slow firing off these NPE events.", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2013-09-08T18:19:34.000+0000", "updated": "2013-09-08T18:19:34.000+0000" }, { "id": "272955", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can confirm this issue with SDK 3.2.0.v20130828101643 too.", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-26T11:33:32.000+0000", "updated": "2013-09-26T11:33:32.000+0000" }, { "id": "273610", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey guys, any news on this? Is really important for one of my projects.\r\nThis happens on the next device:\r\n\r\n*Android 2.3.3*\r\n*Samsung Galaxy S2*\r\n\r\nThank you.", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-02T16:29:54.000+0000", "updated": "2013-10-02T16:29:54.000+0000" }, { "id": "273612", "author": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "body": "Bug confirmed on *Droid 2*, *Droid X* running *Android 2.3.3*", "updateAuthor": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "created": "2013-10-02T16:38:38.000+0000", "updated": "2013-10-02T16:38:38.000+0000" }, { "id": "273621", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi All--We have QE on this. Once we've made sure we can reproduce it as well, we will fix it ASAP.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T17:19:10.000+0000", "updated": "2013-10-02T17:19:10.000+0000" }, { "id": "273626", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Cannot reproduce* with:\n*Nexus 4 Android version 4.3*\nAppcelerator Studio, build: 3.1.3.201309132456\nTitanium SDK, build 3.1.4.v20130927154557", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T17:43:54.000+0000", "updated": "2013-10-02T17:43:54.000+0000" }, { "id": "273636", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~oromero] Did you see that everybody says *android 2.3.3* ?", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-02T17:53:14.000+0000", "updated": "2013-10-02T17:53:14.000+0000" }, { "id": "273639", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "rborn It is just FYI, and yes, of course I *did* see it\r\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T17:58:16.000+0000", "updated": "2013-10-02T17:58:51.000+0000" }, { "id": "273641", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Oh, cool, thank you :)\r\n", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-02T18:05:16.000+0000", "updated": "2013-10-02T18:05:16.000+0000" }, { "id": "273922", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Could not reproduce with:\r\nSony Ericsson Arc S version 2.3.3\r\nAppcelerator Studio, build: 3.2.0.201309142421\r\nTitanium Studio, build: 3.1.3.201309132423\r\nTi SDK: 3.1.3GA\r\n", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-05T01:09:59.000+0000", "updated": "2013-10-05T01:12:19.000+0000" }, { "id": "273923", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello all,\r\n\r\nWe have tried many devices with this, and are unable to reproduce. We have tried 2.3.6, 2.3.4, 2.2.3, and finally got ourselves someone's personal device and installed 2.3.3. We focused on 3.1.3.GA as 3.2.0 is having some structural changes that require 3.2.0 CLI/3.2.0 SDK & 3.2.0 Studio to fully utilize.\r\n\r\nSo please try 3.1.3.GA. If you need 3.2.0 please ensure you are using the combination of components listed above. If using just the CLI, please ensure you use \"ti sdk select\" to set the active SDK to the one you wish.\r\n\r\nOur next goal will be to try this with 3.2.0 on a variety of devices.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-05T01:20:03.000+0000", "updated": "2013-10-05T01:20:29.000+0000" }, { "id": "273984", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "I am using the latest Ti CLI (3.2.0) and I don't use Studio at all.\r\n\r\n", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-07T11:36:59.000+0000", "updated": "2013-10-07T11:36:59.000+0000" }, { "id": "274090", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "+Tested with:+\nAndroid emulator running 2.3.3\nMac OSX - 10.8.5\n\nTI SDK: 3.2.0.v20131007104043\nTI CLI: 3.2.0\nNull Pointer Exception was thrown\n\nTI SDK: 3.1.3.GA\nTI CLI: 3.2.0\nNo errors, worked as expected\n\nTI SDK: 3.2.0.v20131007104043\nTI CLI: 3.1.3.GA\nNull Pointer Exception was thrown\n\n+Tried with device+\nSony Xperia arc S running 2.3.3\nTI SDK: 3.2.0.v20131007104043\nTI CLI: 3.2.0\nNull Pointer Exception was thrown\n\nDroid3 running 2.3.4\nTI SDK: 3.2.0.v20131007104043\nTI CLI: 3.2.0\nNull Pointer Exception was thrown\n\nNexus 4 running 4.2\nTI SDK: 3.2.0.v20131007104043\nTI CLIL 3.2.0\nNo errors, worked as expected", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-07T22:45:51.000+0000", "updated": "2013-10-07T22:45:51.000+0000" }, { "id": "275847", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Looks like 2.3 satisfies the isBlob check for null value, moved the isNull check to the top so that null value will be handled first.\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4812", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-19T18:25:05.000+0000", "updated": "2013-10-19T18:25:05.000+0000" }, { "id": "277006", "author": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey guys, when will this PR be merged into the master source? We cannot push further the android version because of this one.\r\nThank you.", "updateAuthor": { "name": "rborn", "key": "rborn", "displayName": "Dan Tamas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-28T18:57:09.000+0000", "updated": "2013-10-28T18:57:09.000+0000" }, { "id": "277782", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified and working on:\nMac OSX 10.9 Mavericks\nTitanium Studio, build: 3.2.0.201310312257\nTitanium SDK, build: 3.2.0.v20131101124843\nCLI: 3.2.2\nAlloy: 1.2.2\n\nAndroid Emulator: 2.3.3, 4.0.3, 4.4\nAndroid Device: Samsung Galaxy Nexus 4.2.2, Sony Ericsson Arc S 2.3.3\n\nNo null pointer exception thrown. Code displays correct output.\nClosing bug.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T23:20:41.000+0000", "updated": "2013-11-01T23:20:41.000+0000" } ], "maxResults": 21, "total": 21, "startAt": 0 } } }