mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 22:25:44 +03:00
prevent npe
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
f284d3bcb6
commit
83f7be14c5
2 changed files with 15 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -901,4 +901,5 @@
|
|||
<string name="copied_to_clipboard">Copied to clipboard</string>
|
||||
<string name="download_latest_dev_version">Download latest dev version</string>
|
||||
<string name="changelog_dev_version">Changelog dev version</string>
|
||||
<string name="could_not_download_image">Could not download full image</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue