소스 검색

Fixed crash in test of files downloading / uploading

David A. Velasco 12 년 전
부모
커밋
35b25f04eb
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/com/owncloud/android/files/services/FileDownloader.java
  2. 1 0
      src/com/owncloud/android/files/services/FileUploader.java

+ 1 - 0
src/com/owncloud/android/files/services/FileDownloader.java

@@ -198,6 +198,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
          * @param file          A file that could be in the queue of downloads.
          */
         public boolean isDownloading(Account account, OCFile file) {
+            if (account == null || file == null) return false;
             String targetKey = buildRemoteName(account, file);
             synchronized (mPendingDownloads) {
                 if (file.isDirectory()) {

+ 1 - 0
src/com/owncloud/android/files/services/FileUploader.java

@@ -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()) {