New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 #17

Closed
ape-report opened this Issue Mar 7, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@ape-report

ape-report commented Mar 7, 2018

Reproduce:

  1. Take a photo and return
  2. Click the duplicate icon and select the top-leftmost picture. Make sure there is only one picture available.
  3. Rotate your phone. (Set your phone to auto-rotate)
  4. Click DELETE PICTURE.

A more detailed bug report is available at https://ape-report.github.io/report/report-com.dozingcatsoftware.asciicam/com.dozingcatsoftware.asciicam-214/.
To reproduce, please follow instructions from CLICK@211 to CLICK@214.

// java.lang.RuntimeException: Unable to resume activity {com.dozingcatsoftware.asciicam/com.dozingcatsoftware.asciicam.LibraryActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=1, data=null} to activity {com.dozingcatsoftware.asciicam/com.dozingcatsoftware.asciicam.LibraryActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
//  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
//  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
//  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
//  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)
//  at android.app.ActivityThread.-wrap15(ActivityThread.java)
//  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
//  at android.os.Handler.dispatchMessage(Handler.java:102)
//  at android.os.Looper.loop(Looper.java:148)
//  at android.app.ActivityThread.main(ActivityThread.java:5417)
//  at java.lang.reflect.Method.invoke(Native Method)
//  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
//  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
// Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=1, data=null} to activity {com.dozingcatsoftware.asciicam/com.dozingcatsoftware.asciicam.LibraryActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
//  at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
//  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3089)
//  ... 11 more
// Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
//  at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
//  at java.util.ArrayList.get(ArrayList.java:308)
//  at com.dozingcatsoftware.asciicam.LibraryActivity.onActivityResult(LibraryActivity.java:124)
//  at android.app.Activity.dispatchActivityResult(Activity.java:6456)
//  at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
//  ... 12 more
@DeanVanGreunen

This comment has been minimized.

DeanVanGreunen commented Mar 9, 2018

one should do a null check on the .getData() function first on this line

the reason this should be done is to check if there is an image which can be preview, so it is erroring when looking for the .getPath() on the .getData() array return function, which it is erroring, or there is another array which this needs to have null check as well, the code which renders the "preview image" should have the check placed in that sections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment