OC-1508: App crashes when changing the orientation
[pub/Android/ownCloud.git] / src / com / owncloud / android / syncadapter / AbstractOwnCloudSyncAdapter.java
index 469ee3b..e9f7a9b 100644 (file)
@@ -28,7 +28,8 @@ import org.apache.http.client.ClientProtocolException;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;\r
 import org.apache.http.protocol.HttpContext;\r
 \r
-import com.owncloud.android.AccountUtils;\r
+import com.owncloud.android.authentication.AccountUtils;\r
+import com.owncloud.android.authentication.AccountUtils.AccountNotFoundException;\r
 import com.owncloud.android.datamodel.DataStorageManager;\r
 import com.owncloud.android.network.OwnCloudClientUtils;\r
 \r
@@ -142,10 +143,8 @@ public abstract class AbstractOwnCloudSyncAdapter extends
         return null;\r
     }\r
 \r
-    protected void initClientForCurrentAccount() throws OperationCanceledException, AuthenticatorException, IOException {\r
-        if (AccountUtils.constructFullURLForAccount(getContext(), account) == null) {\r
-            throw new UnknownHostException();\r
-        }\r
+    protected void initClientForCurrentAccount() throws OperationCanceledException, AuthenticatorException, IOException, AccountNotFoundException {\r
+        AccountUtils.constructFullURLForAccount(getContext(), account);\r
         mClient = OwnCloudClientUtils.createOwnCloudClient(account, getContext());\r
     }\r
     \r