Fixed crash after app updates due to changed serialization id in RemoteOperationResult
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / DetectAuthenticationMethodOperation.java
index a30829b..560109f 100644 (file)
@@ -94,11 +94,11 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
         client.setFollowRedirects(false);
         
         // try to access the root folder, following redirections but not SAML SSO redirections
-        do {
+        result = operation.execute(client);
+        while (result.isTemporalRedirection() && !result.isIdPRedirection()) {
+            client.setWebdavUri(Uri.parse(result.getRedirectedLocation()));
             result = operation.execute(client);
-            client.setBaseUri(Uri.parse(result.getRedirectedLocation()));
-            
-        } while (result.isTemporalRedirection() && !result.isIdPRedirection());
+        } 
 
         // analyze response  
         if (result.getCode() == ResultCode.UNAUTHORIZED) {