Merge pull request #2622 from nextcloud/preview-bitmap-npe

ui:preview Verify that bitmap is not null before setting imageDrawable.
This commit is contained in:
Andy Scherzinger 2018-05-25 12:59:28 +02:00 committed by GitHub
commit 27b503d2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -610,11 +610,9 @@ public class PreviewImageFragment extends FileFragment {
final PhotoView imageView = mImageViewRef.get();
Bitmap bitmap = result.bitmap;
if (imageView != null) {
if (bitmap != null) {
Log_OC.d(TAG, "Showing image with resolution " + bitmap.getWidth() + "x" +
bitmap.getHeight());
}
if (imageView != null && bitmap != null) {
Log_OC.d(TAG, "Showing image with resolution " + bitmap.getWidth() + "x" +
bitmap.getHeight());
if (result.ocFile.getMimetype().equalsIgnoreCase(MIME_TYPE_PNG) ||
result.ocFile.getMimetype().equalsIgnoreCase(MIME_TYPE_SVG) ||