From: jabarros Date: Thu, 18 Sep 2014 10:44:42 +0000 (+0200) Subject: Fixed bug. When there is a downloaded file which is not support as tiff, app crashes X-Git-Tag: oc-android-1.7.0_signed~163^2~6 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/6c55a20389285cad8eda06ff1a665f97caf59e46?ds=inline;hp=--cc Fixed bug. When there is a downloaded file which is not support as tiff, app crashes --- 6c55a20389285cad8eda06ff1a665f97caf59e46 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