瀏覽代碼

Fix async task call when no content uris received

Juan Carlos González Cabrero 9 年之前
父節點
當前提交
e1a9203c33
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/com/owncloud/android/ui/activity/Uploader.java

+ 5 - 3
src/com/owncloud/android/ui/activity/Uploader.java

@@ -574,9 +574,11 @@ public class Uploader extends FileActivity
             }
         }
 
-        /// content: uris will be copied to temporary files before calling {@link FileUploader}
-        copyThenUpload(contentUris.toArray(new Uri[contentUris.size()]),
-            contentRemotePaths.toArray(new String[contentRemotePaths.size()]));
+        if(!contentUris.isEmpty()) {
+            /// content: uris will be copied to temporary files before calling {@link FileUploader}
+            copyThenUpload(contentUris.toArray(new Uri[contentUris.size()]),
+                contentRemotePaths.toArray(new String[contentRemotePaths.size()]));
+        }
 
         // Save the path to shared preferences; even if upload is not possible, user chose the folder
         SharedPreferences.Editor appPrefs = PreferenceManager