No preview available: swiping back to an image, and then attempting to download full res crash: `IllegalStateException: Fragment PreviewImageFragment` #7808
You get a banner of 'No resized image available. Download full image?`
Swipe left/right to a different image
Swipe back to an image
Press 'Yes on the prompt'
Crash
Actual behaviour
************ CAUSE OF ERROR ************
java.lang.IllegalStateException: Fragment PreviewImageFragment{664772} (9721b654-8491-43f8-a319-f75dd1f46fa2)} not attached to a context.
at androidx.fragment.app.Fragment.requireContext(Fragment.java:805)
at androidx.fragment.app.Fragment.getResources(Fragment.java:869)
at com.owncloud.android.ui.preview.PreviewImageFragment.lambda$setErrorPreviewMessage$2$PreviewImageFragment(PreviewImageFragment.java:744)
at com.owncloud.android.ui.preview.-$$Lambda$PreviewImageFragment$lYlNRKiEmwgldJH0g5sQ-_uYXY4.onClick(Unknown Source:2)
at com.google.android.material.snackbar.Snackbar$1.onClick(Snackbar.java:307)
at android.view.View.performClick(View.java:7259)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:992)
at android.view.View.performClickInternal(View.java:7236)
at android.view.View.access$3600(View.java:801)
at android.view.View$PerformClick.run(View.java:27892)
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:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30140190
Build flavor: generic
************ DEVICE INFORMATION ************
Brand: OnePlus
Device: OnePlus5T
Model: ONEPLUS A5010
Id: QQ3A.200805.001
Product: OnePlus5T
************ FIRMWARE ************
SDK: 29
Release: 10
Incremental: 9cce4d08bf
Dumpling Lineage latest (no google apps and services and stuff, though it's the fdroid version).
NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate
Steps to reproduce
Actual behaviour
Can you reproduce this problem on https://try.nextcloud.com?
Yes
Environment data
Dumpling Lineage latest (no google apps and services and stuff, though it's the fdroid version).
NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate