Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No preview available: swiping back to an image, and then attempting to download full res crash: IllegalStateException: Fragment PreviewImageFragment #7808

Closed
jtagcat opened this issue Jan 11, 2021 · 2 comments
Assignees

Comments

@jtagcat
Copy link

jtagcat commented Jan 11, 2021

Steps to reproduce

  1. Open an image without previee
  2. You get a banner of 'No resized image available. Download full image?`
  3. Swipe left/right to a different image
  4. Swipe back to an image
  5. Press 'Yes on the prompt'
  6. 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

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

@tobiasKaminsky
Copy link
Member

Related to #8054

@joshtrichards joshtrichards added the performance: general/non-specific lag, ANR, etc and rarer exceptions/errors that don't have their own labels label Dec 12, 2023
@joshtrichards joshtrichards changed the title No preview available: swiping back to an image, and then attempting to download full res crashes app. No preview available: swiping back to an image, and then attempting to download full res crash: IllegalStateException: Fragment PreviewImageFragment Dec 12, 2023
@joshtrichards joshtrichards added performance: ISE/IAE 😕 Illegal State Exception / Illegal Argument Exception and removed performance: general/non-specific lag, ANR, etc and rarer exceptions/errors that don't have their own labels labels Dec 20, 2023
@parneet-guraya parneet-guraya self-assigned this Sep 4, 2024
@parneet-guraya
Copy link
Contributor

The snackbar message keeps showing even if we're away from the image on which it was shown. Now fragment is detached but snackbar still carry the lambda and now pressing download would cause a crash.

I fixed here the snackbar to be shown only in the respective fragment in which the error occurred. So now it won't happen. Here: #13512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants