浏览代码

codacy: Avoid declaring a variable if it is unreferenced before a possible exit point.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 5 年之前
父节点
当前提交
1d3fca653f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

+ 2 - 2
src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -303,13 +303,13 @@ public class DocumentsStorageProvider extends DocumentsProvider {
             throws FileNotFoundException {
         Log.d(TAG, "openDocumentThumbnail(), id=" + documentId);
 
-        Document document = toDocument(documentId);
-
         Context context = getContext();
         if (context == null) {
             throw new FileNotFoundException("Context may not be null!");
         }
 
+        Document document = toDocument(documentId);
+        
         boolean exists = ThumbnailsCacheManager.containsBitmap(ThumbnailsCacheManager.PREFIX_THUMBNAIL
                                                                    + document.getFile().getRemoteId());