nextcloud / nextcloud/android

Unexpected behavior (all files layout displayed) after clicking on details in media tab

Open
#12,163 1 comment 0 reactions 0 assignees View on GitHub
bug feature: media tab navigation performance: NPE :no_entry_sign: stable-3.28
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [X] This is a **bug**, not a question or an enhancement.
- [X] I've [searched for similar issues](https://github.com/nextcloud/android/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](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

1. Go to media tab
2. Click on Image that is located in a folder (root images have still unexpected behavior but not all files layout)
3. Click on three dots -> Details
4. Click on back to leave image view
First Issue: Back Arrow is visible at the top
5. Click on back again
All Files Layout including "+" button is visible. App crashes when clicking "+"-button

### Expected behaviour

After exiting the detail/ image view the media tab should behave like always

### Actual behaviour

The media tab has the all files layout and crashes when interacted with e.g. "+"-Button. The menu also displays "all files" as selected but media tab is still open.
![Screenshot_2023-11-13-16-31-53-91_367f977887f4a5f4712ef04f9b973e21](https://github.com/nextcloud/android/assets/43114340/2a9d5289-52b2-4bd3-84d7-a10d553c4f06)

### Android version

12

### Device brand and model

OnePlus Nord 2

### Stock or custom OS?

Stock

### Nextcloud android app version

3.26.0 (and current master)

### Nextcloud server version

27.1.3.2

### Using a reverse proxy?

I don't know

### Android logs

### Cause of error
```java
Exception in thread "main" java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.owncloud.android.datamodel.OCFile.isEncrypted()' on a null object reference
at com.owncloud.android.ui.fragment.OCFileListBottomSheetDialog.onCreate(OCFileListBottomSheetDialog.java:107)
at android.app.Dialog.dispatchOnCreate(Dialog.java:450)
at android.app.Dialog.show(Dialog.java:332)
at com.owncloud.android.ui.fragment.OCFileListFragment.lambda$registerFabListener$2(OCFileListFragment.java:503)
at com.owncloud.android.ui.fragment.OCFileListFragment.$r8$lambda$5tKZbsun13Yjq-4N9PoDf-52bAc(Unknown Source:0)
at com.owncloud.android.ui.fragment.OCFileListFragment$$ExternalSyntheticLambda6.onClick(Unknown Source:4)
at android.view.View.performClick(View.java:7498)
at android.view.View.performClickInternal(View.java:7471)
at android.view.View.access$3700(View.java:843)
at android.view.View$PerformClick.run(View.java:29098)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8248)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30260090`
* Build flavor: `gplay`

### Device information
* Brand: `OnePlus`
* Device: `OP515BL1`
* Model: `DN2103`
* Id: `SP1A.210812.016`
* Product: `DN2103EEA`

### Firmware
* SDK: `31`
* Release: `12`
* Incremental: `R.GDPR.202210192216`

### Server error logs

_No response_

### Additional information

Log from crash when clicking on "+"-Button

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.