From 0f1f232c16aac180ca3062fcdddb265e2e877d5c Mon Sep 17 00:00:00 2001 From: davigonz Date: Wed, 12 Feb 2020 10:51:49 +0100 Subject: [PATCH] Fix crash when client is revoked from web UI --- .../java/com/owncloud/android/lib/common/OwnCloudClient.java | 5 +++-- .../owncloud/android/lib/common/OwnCloudClientFactory.java | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java index 835f50e6..5c4ae8e6 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java @@ -334,7 +334,6 @@ public class OwnCloudClient extends HttpClient { if (invalidated) { if (getCredentials().authTokenCanBeRefreshed() && repeatCounter < MAX_REPEAT_COUNT_WITH_FRESH_CREDENTIALS) { - try { mAccount.loadCredentials(getContext()); // if mAccount.getCredentials().length() == 0 --> refresh failed @@ -342,7 +341,9 @@ public class OwnCloudClient extends HttpClient { credentialsWereRefreshed = true; } catch (AccountsException | IOException e) { - Timber.e(e, "Error while trying to refresh auth token for %s", mAccount.getSavedAccount().name); + Timber.e(e, "Error while trying to refresh auth token for %s", + mAccount.getSavedAccount().name + ); } } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java index 94a44c26..99c5641a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java @@ -37,8 +37,7 @@ public class OwnCloudClientFactory { * @param context Android context where the OwnCloudClient is being created. * @return A OwnCloudClient object ready to be used */ - public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, - boolean followRedirects) { + public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects) { OwnCloudClient client = new OwnCloudClient(uri); client.setFollowRedirects(followRedirects);