From 6c55a20389285cad8eda06ff1a665f97caf59e46 Mon Sep 17 00:00:00 2001 From: jabarros Date: Thu, 18 Sep 2014 12:44:42 +0200 Subject: [PATCH] Fixed bug. When there is a downloaded file which is not support as tiff, app crashes --- src/com/owncloud/android/ui/adapter/FileListListAdapter.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java index 038a6272..e8615f08 100644 --- a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java @@ -172,10 +172,13 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { if (file.isDown()){ Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath()); - thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); - // Add thumbnail to cache - addBitmapToCache(imageKey, thumbnail); + if (bitmap != null) { + thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); + + // Add thumbnail to cache + addBitmapToCache(imageKey, thumbnail); + } } else { // Download thumbnail from server -- 2.11.0