1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix crash when client is revoked from web UI

This commit is contained in:
davigonz 2020-02-12 10:51:49 +01:00
parent 4a9eb24d69
commit 0f1f232c16
2 changed files with 4 additions and 4 deletions

View File

@ -334,7 +334,6 @@ public class OwnCloudClient extends HttpClient {
if (invalidated) { if (invalidated) {
if (getCredentials().authTokenCanBeRefreshed() && if (getCredentials().authTokenCanBeRefreshed() &&
repeatCounter < MAX_REPEAT_COUNT_WITH_FRESH_CREDENTIALS) { repeatCounter < MAX_REPEAT_COUNT_WITH_FRESH_CREDENTIALS) {
try { try {
mAccount.loadCredentials(getContext()); mAccount.loadCredentials(getContext());
// if mAccount.getCredentials().length() == 0 --> refresh failed // if mAccount.getCredentials().length() == 0 --> refresh failed
@ -342,7 +341,9 @@ public class OwnCloudClient extends HttpClient {
credentialsWereRefreshed = true; credentialsWereRefreshed = true;
} catch (AccountsException | IOException e) { } 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
);
} }
} }

View File

@ -37,8 +37,7 @@ public class OwnCloudClientFactory {
* @param context Android context where the OwnCloudClient is being created. * @param context Android context where the OwnCloudClient is being created.
* @return A OwnCloudClient object ready to be used * @return A OwnCloudClient object ready to be used
*/ */
public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects) {
boolean followRedirects) {
OwnCloudClient client = new OwnCloudClient(uri); OwnCloudClient client = new OwnCloudClient(uri);
client.setFollowRedirects(followRedirects); client.setFollowRedirects(followRedirects);