[TIMOB-26317] Android: exception handler throws a NullPointerException
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-09-10T19:55:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | Android |
Labels | n/a |
Reporter | Luc-Edmond Gaspard |
Assignee | Gary Mathews |
Created | 2018-08-18T02:00:27.000+0000 |
Updated | 2018-09-10T19:55:59.000+0000 |
Description
Hi, I had these issue while I was debugging a native module.
When a java exception occurs, a NullPointerException is thrown when
jsstack
is null, trying to call .contains
on a null string.
https://github.com/appcelerator/titanium_mobile/blob/dc00603cdc187b56531b615ce8e864c6597157f4/android/titanium/src/java/org/appcelerator/titanium/TiExceptionHandler.java#L100-L105
{quote}
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contains(java.lang.CharSequence)' on a null object reference
at org.appcelerator.titanium.TiExceptionHandler.getError(TiExceptionHandler.java:100)
at org.appcelerator.titanium.TiExceptionHandler.handleOpenErrorDialog(TiExceptionHandler.java:141)
at org.appcelerator.titanium.TiExceptionHandler.openErrorDialog(TiExceptionHandler.java:121)
at org.appcelerator.titanium.TiExceptionHandler.handleException(TiExceptionHandler.java:246)
at org.appcelerator.kroll.KrollRuntime.dispatchException(KrollRuntime.java:540)
at org.appcelerator.titanium.TiApplication$1.uncaughtException(TiApplication.java:365)
at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:677)
at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
... 9 more
{quote}
Also, the new exception handler doesn't include the java exception title and message.
master: https://github.com/appcelerator/titanium_mobile/pull/10271
Verified the fix with SDK 7.5.0.v20180906093938. Closing. Studio Ver: 5.1.1.201809051655 SDK Ver: 7.5.0.v20180906093938 OS Ver: 10.13.5 Xcode Ver: Xcode 9.4.1 Appc NPM: 4.2.13 Appc CLI: 7.0.6 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.2 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.2 Devices: ⇨ google Nexus 5 (Android 6.0.1) ⇨ google Nexus 6P (Android 8.1.0)