avoid NPE

This commit is contained in:
tobiasKaminsky 2015-12-02 20:23:07 +01:00
parent 366ec0b472
commit e9bf119fa4

View file

@ -182,7 +182,7 @@ public class ThumbnailsCacheManager {
if (mFile instanceof OCFile) { if (mFile instanceof OCFile) {
thumbnail = doOCFileInBackground(); thumbnail = doOCFileInBackground();
if (((OCFile) mFile).isVideo()){ if (((OCFile) mFile).isVideo() && thumbnail != null){
thumbnail = addVideoOverlay(thumbnail); thumbnail = addVideoOverlay(thumbnail);
} }
} else if (mFile instanceof File) { } else if (mFile instanceof File) {
@ -191,7 +191,7 @@ public class ThumbnailsCacheManager {
String url = ((File) mFile).getAbsolutePath(); String url = ((File) mFile).getAbsolutePath();
String mMimeType = FileStorageUtils.getMimeTypeFromName(url); String mMimeType = FileStorageUtils.getMimeTypeFromName(url);
if (mMimeType != null && mMimeType.startsWith("video/")){ if (mMimeType != null && mMimeType.startsWith("video/") && thumbnail != null){
thumbnail = addVideoOverlay(thumbnail); thumbnail = addVideoOverlay(thumbnail);
} }
//} else { do nothing //} else { do nothing