Skip to content

Rare chrashes where mArgs causes a null pointer exception #234

@sithwarrior

Description

@sithwarrior

For our App, we are seeing some crashes in our Android ANR console, and they point to mArgs being null.

You can see it points to onCreate line 67

Exception java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3751) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3919) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2311) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loopOnce (Looper.java:238) at android.os.Looper.loop (Looper.java:357) at android.app.ActivityThread.main (ActivityThread.java:8090) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1026) Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONArray.getString(int)' on a null object reference at com.sarriaroman.PhotoViewer.PhotoActivity.onCreate (PhotoActivity.java:67) at android.app.Activity.performCreate (Activity.java:8232) at android.app.Activity.performCreate (Activity.java:8212) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1331) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3724)

com.sarriaroman.PhotoViewer.PhotoActivity.onCreate (PhotoActivity.java:67

I think this might be cause by how mArgs is being assigned, so I did a PR where mArgs are assigned by putExtra instead.

#233

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions