浏览代码

Show snackbar message instead throwing exception

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 11 月之前
父节点
当前提交
7fd13cb609

+ 3 - 2
app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java

@@ -804,7 +804,8 @@ public class ReceiveExternalFilesActivity extends FileActivity
 
     private void startSyncFolderOperation(OCFile folder) {
         if (folder == null) {
-            throw new IllegalArgumentException("Folder must not be null");
+            DisplayUtils.showSnackMessage(this, R.string.receive_external_files_activity_start_sync_folder_is_not_exists_message);
+            return;
         }
 
         long currentSyncTime = System.currentTimeMillis();
@@ -1070,7 +1071,7 @@ public class ReceiveExternalFilesActivity extends FileActivity
     }
 
     private void browseToRoot() {
-        OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
+        OCFile root = getStorageManager().getFileByEncryptedRemotePath(OCFile.ROOT_PATH);
         mFile = root;
         mParents.clear();
         mParents.add("");

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -448,6 +448,8 @@
     <string name="clipboard_unexpected_error">Unexpected error while copying to clipboard</string>
     <string name="clipboard_label">Text copied from %1$s</string>
 
+    <string name="receive_external_files_activity_start_sync_folder_is_not_exists_message">Folder cannot be found, sync operation is cancelled</string>
+
     <string name="error_cant_bind_to_operations_service">Critical error: Unable to perform operations</string>
 
     <string name="network_error_socket_exception">An error occurred during connection to the server</string>