mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Fix crash when client is revoked from web UI
This commit is contained in:
		
							parent
							
								
									4a9eb24d69
								
							
						
					
					
						commit
						0f1f232c16
					
				| @ -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 | ||||||
|  |                         ); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user