Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#2598 closed defect (fixed)

Crash: java.lang.NullPointerException net.i2p.android.i2ptunnel.TunnelDetailFragment.onCreate

Reported by: Meeh Owned by: Meeh
Priority: minor Milestone: 0.9.42
Component: apps/android Version: 0.9.41
Keywords: Cc: zzz, idk
Parent Tickets: Sensitive: no

Description

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2984)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3045)
  at android.app.ActivityThread.-wrap14 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1642)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6776)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1386)
Caused by: java.lang.NullPointerException: 
  at net.i2p.android.i2ptunnel.TunnelDetailFragment.onCreate (TunnelDetailFragment.java:84)
  at android.support.v4.app.Fragment.performCreate (Fragment.java:2414)
  at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1418)
  at android.support.v4.app.FragmentTransition.addToFirstInLastOut (FragmentTransition.java:1195)
  at android.support.v4.app.FragmentTransition.calculateFragments (FragmentTransition.java:1078)
  at android.support.v4.app.FragmentTransition.startTransitions (FragmentTransition.java:117)
  at android.support.v4.app.FragmentManagerImpl.executeOpsTogether (FragmentManager.java:2408)
  at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute (FragmentManager.java:2366)
  at android.support.v4.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2273)
  at android.support.v4.app.FragmentManagerImpl.dispatchStateChange (FragmentManager.java:3273)
  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated (FragmentManager.java:3229)
  at android.support.v4.app.FragmentController.dispatchActivityCreated (FragmentController.java:201)
  at android.support.v4.app.FragmentActivity.onStart (FragmentActivity.java:620)
  at android.support.v7.app.AppCompatActivity.onStart (AppCompatActivity.java:178)
  at net.i2p.android.I2PActivityBase.onStart (I2PActivityBase.java:55)
  at net.i2p.android.i2ptunnel.TunnelDetailActivity.onStart (TunnelDetailActivity.java:32)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1256)
  at android.app.Activity.performStart (Activity.java:6972)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2937)

Subtickets

Change History (5)

comment:1 Changed 3 months ago by Meeh

Google play for some odd reason count this issue 8 times in a row, where none of them where detected to be alike.

comment:2 Changed 3 months ago by Meeh

Suggesting patch:

--- app/src/main/java/net/i2p/android/i2ptunnel/TunnelDetailFragment.java	bfd88a5bbab3820d89220413e6e1767569238df3
+++ app/src/main/java/net/i2p/android/i2ptunnel/TunnelDetailFragment.java	fe14035d9ae348f1fcda0c99e129e6d36e45c938
@@ -80,8 +80,10 @@ public class TunnelDetailFragment extend
         List<TunnelController> controllers;
         try {
             mGroup = TunnelControllerGroup.getInstance();
-            error = mGroup == null ? getResources().getString(R.string.i2ptunnel_not_initialized) : null;
-            controllers = mGroup.getControllers();
+            if (mGroup != null) {
+                error = mGroup == null ? getResources().getString(R.string.i2ptunnel_not_initialized) : null;
+                controllers = mGroup.getControllers();
+            }
         } catch (IllegalArgumentException iae) {
             mGroup = null;
             controllers = null;

comment:3 Changed 3 months ago by Meeh

nvm last one. maybe

--- app/src/main/java/net/i2p/android/i2ptunnel/TunnelDetailFragment.java	bfd88a5bbab3820d89220413e6e1767569238df3
+++ app/src/main/java/net/i2p/android/i2ptunnel/TunnelDetailFragment.java	2e6425a1af65f20c135c82b237bfed89a6607478
@@ -81,7 +81,7 @@ public class TunnelDetailFragment extend
         try {
             mGroup = TunnelControllerGroup.getInstance();
             error = mGroup == null ? getResources().getString(R.string.i2ptunnel_not_initialized) : null;
-            controllers = mGroup.getControllers();
+            controllers = mGroup == null ? null : mGroup.getControllers();
         } catch (IllegalArgumentException iae) {
             mGroup = null;
             controllers = null;

comment:4 Changed 3 months ago by Meeh

Resolution: fixed
Status: newclosed

comment:5 Changed 3 months ago by zzz

Milestone: undecided0.9.42
Note: See TracTickets for help on using tickets.