apps-android-commons: IndexOutOfBoundsException when using both custom picker and gallery

  1. Using custom picker, open an album, disable Show already actioned pictures.
  2. With gallery, open the same album, select a few pictures, then upload them, taking a few minutes.
  3. Go back to the app from launcher icon, for me it opened the screen from step 1.
  4. Scroll a bit up and down.
  5. A few pictures disappear as they got uploaded.
  6. Crash:

APP_VERSION_CODE=1035 APP_VERSION_NAME=4.2.0-debug-shankarpriyank-rotate_feature ANDROID_VERSION=14 PHONE_MODEL=Pixel 7 Pro STACK_TRACE=java.lang.IndexOutOfBoundsException: Index 18 out of bounds for length 18 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.customselector.ui.adapter.ImageAdapter.onBindViewHolder(ImageAdapter.kt:122) at fr.free.nrw.commons.customselector.ui.adapter.ImageAdapter.onBindViewHolder(ImageAdapter.kt:29) at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7093) at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7172) at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6037) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6304) at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288) at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345) at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361) at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368) at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 17 (15 by maintainers)

Most upvoted comments

I think I found the problem image It will return -1 as an index when the user language is Chinese Can you reproduce the bug, create a new issue and assign it to me, thank you very much.