[Libreoffice-commits] core.git: android/source

Mert Tumer merttumer at outlook.com
Thu Jul 12 13:56:17 UTC 2018


 android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java |   22 ++++++----
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit ec025525eb892b22a1874a295772f9653624c608
Author: Mert Tumer <merttumer at outlook.com>
Date:   Sun Jul 8 08:04:54 2018 -0700

    tdf#118622 fix unhandled exception when selecting remove server
    
    Change-Id: I5f0f9a1ed4a4e0a62555a33209296128572c4ffb
    Reviewed-on: https://gerrit.libreoffice.org/57159
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java b/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java
index 7ae22a2d7c5f..0852ab617660 100644
--- a/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java
+++ b/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java
@@ -23,6 +23,7 @@ import com.owncloud.android.lib.resources.files.FileUtils;
 import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
 import com.owncloud.android.lib.resources.files.RemoteFile;
 
+
 /**
  * Implementation of IDocumentProvider for ownCloud servers.
  */
@@ -79,15 +80,20 @@ public class OwnCloudProvider implements IDocumentProvider,
 
     @Override
     public IFile createFromUri(Context context, URI uri) {
-        ReadRemoteFileOperation refreshOperation = new ReadRemoteFileOperation(
-                uri.getPath());
-        this.result = refreshOperation.execute(client);
-        if (!result.isSuccess()) {
-            throw buildRuntimeExceptionForResultCode(result.getCode());
-        }
-        if (result.getData().size() > 0) {
-            return new OwnCloudFile(this, (RemoteFile) result.getData().get(0));
+        if(serverUrl != "" || userName != "" || password != ""){
+            ReadRemoteFileOperation refreshOperation = new ReadRemoteFileOperation(
+                    uri.getPath());
+            this.result = refreshOperation.execute(client);
+            if (!result.isSuccess()) {
+                throw buildRuntimeExceptionForResultCode(result.getCode());
+            }
+            if (result.getData().size() > 0) {
+                return new OwnCloudFile(this, (RemoteFile) result.getData().get(0));
+            }
+        } else {
+            throw buildRuntimeExceptionForResultCode(ResultCode.WRONG_CONNECTION);
         }
+
         return null;
     }
 


More information about the Libreoffice-commits mailing list