From b8aa7b61196807454f5124bd0f0ea7c12b687576 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Wed, 17 Aug 2016 10:17:29 +0200 Subject: [PATCH] Changes after CR --- .../resources/users/RemoteGetUserQuotaOperation.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java b/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java index e059cf41..55e976c6 100644 --- a/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java +++ b/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java @@ -27,15 +27,15 @@ package com.owncloud.android.lib.resources.users; -import com.owncloud.android.lib.common.OwnCloudBasicCredentials; import com.owncloud.android.lib.common.OwnCloudClient; +import com.owncloud.android.lib.common.OwnCloudCredentials; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.utils.Log_OC; +import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.http.HttpStatus; import org.json.JSONObject; import java.util.ArrayList; @@ -84,7 +84,7 @@ public class RemoteGetUserQuotaOperation extends RemoteOperation { //Get the user try { - OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials(); + OwnCloudCredentials credentials = client.getCredentials(); String url = client.getBaseUri() + OCS_ROUTE + credentials.getUsername(); get = new GetMethod(url); @@ -127,7 +127,9 @@ public class RemoteGetUserQuotaOperation extends RemoteOperation { Log_OC.e(TAG, "Exception while getting OC user information", e); } finally { - get.releaseConnection(); + if (get != null) { + get.releaseConnection(); + } } return result;