Fixed crash in test of files downloading / uploading
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 9 Jan 2013 09:11:21 +0000 (10:11 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 9 Jan 2013 09:11:21 +0000 (10:11 +0100)
src/com/owncloud/android/files/services/FileDownloader.java
src/com/owncloud/android/files/services/FileUploader.java

index b01d61e..7872c36 100644 (file)
@@ -198,6 +198,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
          * @param file          A file that could be in the queue of downloads.\r
          */\r
         public boolean isDownloading(Account account, OCFile file) {\r
+            if (account == null || file == null) return false;\r
             String targetKey = buildRemoteName(account, file);\r
             synchronized (mPendingDownloads) {\r
                 if (file.isDirectory()) {\r
index 0887ac1..0a03346 100644 (file)
@@ -324,6 +324,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
          * @param file          A file that could be in the queue of pending uploads
          */
         public boolean isUploading(Account account, OCFile file) {
+            if (account == null || file == null) return false;
             String targetKey = buildRemoteName(account, file);
             synchronized (mPendingUploads) {
                 if (file.isDirectory()) {