Skip to content
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

IndexOutOfBoundsException crash when removing last two images of multiupload #6122

Open
nicolas-raoul opened this issue Jan 12, 2025 · 2 comments · May be fixed by #6124
Open

IndexOutOfBoundsException crash when removing last two images of multiupload #6122

nicolas-raoul opened this issue Jan 12, 2025 · 2 comments · May be fixed by #6124
Assignees
Labels

Comments

@nicolas-raoul
Copy link
Member

screen-20250112-142958.mp4
STACK_TRACE=java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at fr.free.nrw.commons.upload.UploadPresenter.deletePictureAtIndex(UploadPresenter.kt:148)
at fr.free.nrw.commons.upload.UploadActivity.onThumbnailDeleted(UploadActivity.java:786)
at fr.free.nrw.commons.upload.ThumbnailsAdapter$ViewHolder.bind$lambda$0(ThumbnailsAdapter.kt:72)
at fr.free.nrw.commons.upload.ThumbnailsAdapter$ViewHolder.$r8$lambda$h9qbE-GosgolnpmsfOlWqsny9oU(Unknown Source:0)
at fr.free.nrw.commons.upload.ThumbnailsAdapter$ViewHolder$$ExternalSyntheticLambda1.onClick(D8$$SyntheticClass:0)
at android.view.View.performClick(View.java:8081)
at android.view.View.performClickInternal(View.java:8058)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:31517)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8934)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
@rohit9625
Copy link
Contributor

I'll take this issue 😀

@rohit9625
Copy link
Contributor

Hey @nicolas-raoul, I've solved the issue and also found a strange behavior that you can see in the screencast below. Removing the last image removes all images except the first one.

Screen_recording_20250113_140703.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants