Closed AssassinRain closed 4 years ago
Hi,
There are many things to unfold here:
Thanks for your interest and implication.
Thanks for your kindly reply. After compile the latest version into an apk and retest, we find that the same crash still can be triggered. Besides, we also find two new bugs. The detailed information are as follows:
The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikifus.padland/com.mikifus.padland.PadViewActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.mikifus.padland.Models.Pad.getUrl()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.mikifus.padland.Models.Pad.getUrl()' on a null object reference at com.mikifus.padland.PadViewActivity._getPadId(PadViewActivity.java:311) at com.mikifus.padland.PadViewActivity._getPadData(PadViewActivity.java:251) at com.mikifus.padland.PadViewActivity._makePadUrl(PadViewActivity.java:218) at com.mikifus.padland.PadViewActivity.onCreate(PadViewActivity.java:118) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikifus.padland/com.mikifus.padland.PadViewActivity}: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1975) at com.mikifus.padland.PadViewActivity.makePadData(PadViewActivity.java:641) at com.mikifus.padland.PadViewActivity._getPadDataFromIntent(PadViewActivity.java:291) at com.mikifus.padland.PadViewActivity._getPadId(PadViewActivity.java:310) at com.mikifus.padland.PadViewActivity._getPadData(PadViewActivity.java:251) at com.mikifus.padland.PadViewActivity._makePadUrl(PadViewActivity.java:218) at com.mikifus.padland.PadViewActivity.onCreate(PadViewActivity.java:118) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikifus.padland/com.mikifus.padland.PadListActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference at com.mikifus.padland.PadListActivity.i(SourceFile:3) at com.mikifus.padland.PadListActivity.onCreate(SourceFile:2) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
Hi,
Thanks for the contribution and patience. I didn't have time to check it but I'm aware of this issue.
Hello. I noticed some crashes in logs. The corresponding commit version of code is 65e551e, and application version is 1.5.
1.com.mikifus.padland.PadViewActivity
The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikifus.padland/com.mikifus.padland.PadViewActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.mikifus.padland.Models.Pad.g()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.mikifus.padland.Models.Pad.g()' on a null object reference at com.mikifus.padland.PadViewActivity.d(SourceFile:5) at com.mikifus.padland.PadViewActivity.k(SourceFile:1) at com.mikifus.padland.PadViewActivity.n(SourceFile:1) at com.mikifus.padland.PadViewActivity.onCreate(SourceFile:2) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
The command to trigger it is: adb shell am start -n com.mikifus.padland/com.mikifus.padland.PadViewActivity
Because all these activities are exported ones, i.e., be exposed to outside, they may receive unfriendly commands and then lead to app crash. After investigation, we found that the missing of null checkers causes those crashes. Please help to confirm whether they are true bugs. We believe that fixing these bugs will further improve the robustness of this app.