Fixed bug. When there is a downloaded file which is not support as tiff, app crashes
authorjabarros <jabarros@solidgear.es>
Thu, 18 Sep 2014 10:44:42 +0000 (12:44 +0200)
committerjabarros <jabarros@solidgear.es>
Thu, 18 Sep 2014 10:44:42 +0000 (12:44 +0200)
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

index 038a627..e8615f0 100644 (file)
@@ -172,10 +172,13 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                 \r
                 if (file.isDown()){\r
                     Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath());\r
-                    thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
                     \r
-                    // Add thumbnail to cache\r
-                    addBitmapToCache(imageKey, thumbnail);\r
+                    if (bitmap != null) {\r
+                        thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
+\r
+                        // Add thumbnail to cache\r
+                        addBitmapToCache(imageKey, thumbnail);\r
+                    }\r
 \r
                 } else {\r
                     // Download thumbnail from server\r