Text-Edit-for-Android icon indicating copy to clipboard operation
Text-Edit-for-Android copied to clipboard

A NullPointerException bug

Open tingsu opened this issue 8 years ago • 1 comments

Hi, thanks for developing this useful app. We recently tested this app by an automated Android GUI testing tool developed by our research team. We found the app could run into a "NullPointerException" error after executing the following actions:

start the app -> press "menu" key -> choose the "open" menu item -> delete the original file name "/sdcard/" in the EditText on the appearing dialog titled with "Open File" -> fill in "test" in the EditText -> click "open" -> click "continue" button on the appearing dialog titled with "test not found" -> the app crashed

Here is the log:

W/dalvikvm( 1076): threadid=1: thread exiting with uncaught exception (group=0x40a13300) E/AndroidRuntime( 1076): FATAL EXCEPTION: main E/AndroidRuntime( 1076): java.lang.NullPointerException E/AndroidRuntime( 1076): at org.paulmach.textedit.pmTextEdit.onPrepareDialog(pmTextEdit.java:951) E/AndroidRuntime( 1076): at android.app.Activity.onPrepareDialog(Activity.java:2988) E/AndroidRuntime( 1076): at android.app.Activity.showDialog(Activity.java:3051) E/AndroidRuntime( 1076): at android.app.Activity.showDialog(Activity.java:3002) E/AndroidRuntime( 1076): at org.paulmach.textedit.pmTextEdit$15.onClick(pmTextEdit.java:1329) E/AndroidRuntime( 1076): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166) E/AndroidRuntime( 1076): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 1076): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 1076): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 1076): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1076): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 1076): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 1076): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 1076): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 150): Force finishing activity org.paulmach.textedit/.pmTextEdit

We carefully inspected the source code, and found the root cause lies in the following code (in "pmTextEdit.java" file) screen shot 2016-04-13 at 7 56 45 pm

Could you please take a look and confirm this bug? Thanks! Ting Su

tingsu avatar Apr 13 '16 11:04 tingsu

Some updates: we have sent an email to the app author, and the bug has been confirmed.

tingsu avatar Apr 27 '16 01:04 tingsu