diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java
index d88cebcfbc..1ef9a9653a 100644
--- a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java
+++ b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java
@@ -694,10 +694,20 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
public void setErrorPreviewMessage() {
try {
if (getActivity() != null) {
- Snackbar.make(mMultiView, R.string.resized_image_not_possible_download, Snackbar.LENGTH_INDEFINITE)
- .setAction(R.string.common_yes, v ->
- ((PreviewImageActivity) getActivity())
- .requestForDownload(getFile())).show();
+ Snackbar.make(mMultiView,
+ R.string.resized_image_not_possible_download,
+ Snackbar.LENGTH_INDEFINITE)
+ .setAction(R.string.common_yes, v -> {
+ PreviewImageActivity activity = ((PreviewImageActivity) getActivity());
+ if (activity != null) {
+ activity.requestForDownload(getFile());
+ } else {
+ Snackbar.make(mMultiView,
+ getResources().getString(R.string.could_not_download_image),
+ Snackbar.LENGTH_INDEFINITE).show();
+ }
+ }
+ ).show();
} else {
Snackbar.make(mMultiView, R.string.resized_image_not_possible, Snackbar.LENGTH_INDEFINITE).show();
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 504ecc58ec..399c7909d0 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -901,4 +901,5 @@
Copied to clipboard
Download latest dev version
Changelog dev version
+ Could not download full image