[TIMOB-25471] Android: TableView : java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.HashMap.containsKey(java.lang.Object)' on a null object reference
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-15T04:29:11.000+0000 |
Affected Version/s | Release 6.3.0 |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | n/a |
Reporter | ankur garha |
Assignee | Gary Mathews |
Created | 2017-11-01T07:33:49.000+0000 |
Updated | 2017-11-15T07:42:04.000+0000 |
Description
It's happening when you have multiple nested windows with table views and click back button quickly to close the application.
Here is the complete crash log:-
11-01 00:56:36.663: E/AndroidRuntime(22347): java.lang.RuntimeException: Unable to destroy activity {com.homeinspectorpro.mobile/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.HashMap.containsKey(java.lang.Object)' on a null object reference
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4244)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4262)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread.-wrap6(ActivityThread.java)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1551)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.os.Handler.dispatchMessage(Handler.java:102)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.os.Looper.loop(Looper.java:154)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread.main(ActivityThread.java:6165)
11-01 00:56:36.663: E/AndroidRuntime(22347): at java.lang.reflect.Method.invoke(Native Method)
11-01 00:56:36.663: E/AndroidRuntime(22347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
11-01 00:56:36.663: E/AndroidRuntime(22347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
11-01 00:56:36.663: E/AndroidRuntime(22347): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.HashMap.containsKey(java.lang.Object)' on a null object reference
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.KrollProxy.hasProperty(KrollProxy.java:580)
11-01 00:56:36.663: E/AndroidRuntime(22347): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:175)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1222)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:516)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:507)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:485)
11-01 00:56:36.663: E/AndroidRuntime(22347): at ti.modules.titanium.ui.TableViewProxy.getTableView(TableViewProxy.java:147)
11-01 00:56:36.663: E/AndroidRuntime(22347): at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:860)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.os.Handler.dispatchMessage(Handler.java:98)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:394)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:379)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:257)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:291)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:191)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:800)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.proxy.TiWindowProxy.closeFromActivity(TiWindowProxy.java:206)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1591)
11-01 00:56:36.663: E/AndroidRuntime(22347): at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:32)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.Activity.performDestroy(Activity.java:6889)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1175)
11-01 00:56:36.663: E/AndroidRuntime(22347): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4231)
11-01 00:56:36.663: E/AndroidRuntime(22347): ... 9 more
Thanks for reporting! Did this not happen before 6.2.x? cc [~jquick]
[~sdarda], would you mind trying to reproduce this please? I suspect that this can happen if you set up a TableView with a SearchView, launch the app, and then quickly back out of the app. You'll likely need to quickly tap the back key as the app is launching (it'll queue the back key event) to reproduce this issue. [~hknoechel], I don't think this is a regression. I suspect this issue has always existed.
master: https://github.com/appcelerator/titanium_mobile/pull/9579
This has existed for a long time. We do definitely have a search view involved and it DOES happen when we quickly back out of the app.
Gary, I tried applying your patch, it solved this problem but its giving rise to another crash. Please find the logs attached below.
[~speedyankur@gmail.com] I've updated the PR, report back after trying the new changes?
Changes are seen in SDK 7.0.0.v20171114203226.