Merge pull request #10430 from Tiam-Abderezai/bugfix/10405/check_context_in_PreviewImageFragment

Fix #10405 Context check for ImagePreviewFragment
This commit is contained in:
Álvaro Brey 2022-08-03 16:30:45 +02:00 committed by GitHub
commit ac948df165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -718,7 +718,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
PreviewImageActivity activity = (PreviewImageActivity) getActivity();
if (activity != null) {
activity.requestForDownload(getFile());
} else {
} else if (getContext() != null) {
Snackbar.make(binding.emptyListView,
getResources().getString(R.string.could_not_download_image),
Snackbar.LENGTH_INDEFINITE).show();