android icon indicating copy to clipboard operation
android copied to clipboard

`ArrayIndexOutOfBoundsException` in `OCFileListAdapter.getItem()`

Open weinic opened this issue 3 years ago • 1 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [ ] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

By use the nc client at any times

Expected behaviour

Empty

Actual behaviour

Empty

Android version

10

Device brand and model

oneplus5

Stock or custom OS?

Stock

Nextcloud android app version

3.21.0

Nextcloud server version

22

Using a reverse proxy?

No

Android logs

Cause of error

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: length=17; index=17
    at java.util.ArrayList.get(ArrayList.java:439)
    at com.owncloud.android.ui.adapter.OCFileListAdapter.getItem(OCFileListAdapter.java:561)
    at com.owncloud.android.ui.adapter.OCFileListAdapter.getItemViewType(OCFileListAdapter.java:596)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6367)
    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:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7697)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

App information

  • ID: com.nextcloud.client
  • Version: 30210090
  • Build flavor: gplay

Device information

  • Brand: OnePlus
  • Device: OnePlus5
  • Model: ONEPLUS A5000
  • Id: QKQ1.191014.012
  • Product: OnePlus5

Firmware

  • SDK: 29
  • Release: 10
  • Incremental: 2010292059

Server error logs

No response

Additional information

No response

weinic avatar Aug 09 '22 20:08 weinic

Possibly a similar fixed as used for GalleryAdapter would work for OCFileListAdapter here - e.g. #10253

Do you have any way of reproducing this problem on demand, @weinic, by chance?

joshtrichards avatar Aug 19 '24 17:08 joshtrichards