Skip to content

Commit

Permalink
avoid NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky authored and davivel committed Aug 22, 2016
1 parent 174b0ea commit 7068445
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected Bitmap doInBackground(Object... params) {
if (mFile instanceof OCFile) {
thumbnail = doOCFileInBackground();

if (((OCFile) mFile).isVideo()){
if (((OCFile) mFile).isVideo() && thumbnail != null){
thumbnail = addVideoOverlay(thumbnail);
}
} else if (mFile instanceof File) {
Expand All @@ -194,7 +194,7 @@ protected Bitmap doInBackground(Object... params) {
FileNameMap fileNameMap = URLConnection.getFileNameMap();
String mMimeType = fileNameMap.getContentTypeFor("file://" + url);

if (mMimeType != null && mMimeType.startsWith("video/")){
if (mMimeType != null && mMimeType.startsWith("video/") && thumbnail != null){
thumbnail = addVideoOverlay(thumbnail);
}
//} else { do nothing
Expand Down

0 comments on commit 7068445

Please sign in to comment.