Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit bbf8d154 authored by Andy Scherzinger's avatar Andy Scherzinger Committed by GitHub
Browse files

Merge pull request #132 from nextcloud/remoteOperationResultMightNull

Remote operation result might been null
parents 7452598e 3a487976
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -99,14 +99,16 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
                client.exhaustResponse(query.getResponseBodyAsStream());
                result = new RemoteOperationResult(false, query);
            }

        } catch (Exception e) {
            result = new RemoteOperationResult(e);


        } finally {
            if (query != null)
                query.releaseConnection();  // let the connection available for other methods

            if (result == null) {
                result = new RemoteOperationResult(new Exception("unknown error"));
                Log_OC.e(TAG, "Synchronized " + mRemotePath + ": failed");
            } else {
                if (result.isSuccess()) {
                    Log_OC.i(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
                } else {
@@ -117,8 +119,9 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
                        Log_OC.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
                    }
                }

            }
        }
        
        return result;
    }