mikifus / padland

Padland is a tool to manage, share, remember and read collaborative documents based on the Etherpad technology in Android.
Apache License 2.0
63 stars 15 forks source link

A unique bug in PadLIstActivity #67

Closed nibienaohehe closed 2 years ago

nibienaohehe commented 2 years ago

Hello, I noticed a unique crash in the latest version when I launch the exported activity PadListActivity. The following commands are used to reproduce the crash:

_Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ComponentName cn=new ComponentName("com.mikifus.padland","com.mikifus.padland.PadListActivity"); intent.setComponent(cn); Bundle ExtrasObj = new Bundle(); ArrayList pad_id_list = new ArrayList(); pad_id_list.add("adf"); ExtrasObj.putStringArrayList("pad_id", pad_idlist); intent.putExtra("action", "delete"); intent.putExtras(ExtrasObj); startActivity(intent);

The exception trace is:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mikifus.padland/com.mikifus.padland.PadListActivity}: java.lang.NumberFormatException: For input string: "asdfa" at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) Caused by: java.lang.NumberFormatException: For input string: "asdfa" at java.lang.Long.parseLong(Long.java:594) at java.lang.Long.parseLong(Long.java:636) at com.mikifus.padland.PadListActivity.i(SourceFile:8) at com.mikifus.padland.PadListActivity.onCreate(SourceFile:2) at android.app.Activity.performCreate(Activity.java:8086) at android.app.Activity.performCreate(Activity.java:8074) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:213)  at android.app.ActivityThread.main(ActivityThread.java:8178)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 

The statement triggering this issue is:

boolean result = padlistDb.deletePad(Long.parseLong(pad_id_list.get(i)));

where pad_id_list.get(i) returns an unchecked string.

mikifus commented 2 years ago

Closing as it is not a bug.