Slowness/crashes in Media Tab (NPE): `Attempt to invoke virtual method 'void com.owncloud.android.ui.adapter.OCFileListAdapter.setGridView(boolean)'`
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
Hi,
Since April or so I'm having trouble with the media tab. Thumbnails are not loaded for anything beyond April, it's very slow in loading, often hangs and sometimes crashes with traces such as the one below.
The NC instance it connects to is an up-to-date NC24.0.2 with preview generator app. In the WebView all thumbnails are there and loaded instantly.
The phone is a Google Pixel 4 with Android 12.
Let me know what info is missing for nailing this down!
All the best,
Simon
### Cause of error
```java
Exception in thread "main" java.lang.NullPointerException: Attempt to invoke virtual method 'void com.owncloud.android.ui.adapter.OCFileListAdapter.setGridView(boolean)' on a null object reference
at com.owncloud.android.ui.fragment.OCFileListFragment.switchLayoutManager(OCFileListFragment.java:1412)
at com.owncloud.android.ui.fragment.OCFileListFragment.switchToListView(OCFileListFragment.java:1368)
at com.owncloud.android.ui.fragment.OCFileListFragment.setListAsPreferred(OCFileListFragment.java:1363)
at com.owncloud.android.ui.fragment.OCFileListFragment.lambda$onActivityCreated$1$com-owncloud-android-ui-fragment-OCFileListFragment(OCFileListFragment.java:391)
at com.owncloud.android.ui.fragment.OCFileListFragment$$ExternalSyntheticLambda7.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7455)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1131)
at android.view.View.performClickInternal(View.java:7432)
at android.view.View.access$3700(View.java:835)
at android.view.View$PerformClick.run(View.java:28810)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
```
### App information
* ID: `com.nextcloud.client`
* Version: `30200390`
* Build flavor: `gplay`
### Device information
* Brand: `google`
* Device: `flame`
* Model: `Pixel 4`
* Id: `SQ3A.220605.009.A1`
* Product: `flame`
### Firmware
* SDK: `32`
* Release: `12`
* Incremental: `8643238`
Contributor guide
Assessment
This issue has not been assessed yet.