From c2d9b468e7e959094c9138097dea4a46fbf64d9d Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Jun 2020 15:44:03 +0200 Subject: [PATCH] Fix crash when creating client Signed-off-by: tobiasKaminsky --- .../com/nextcloud/client/network/ClientFactoryImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nextcloud/client/network/ClientFactoryImpl.java b/src/main/java/com/nextcloud/client/network/ClientFactoryImpl.java index 7aa1f8eb4bd9..6a453f5952eb 100644 --- a/src/main/java/com/nextcloud/client/network/ClientFactoryImpl.java +++ b/src/main/java/com/nextcloud/client/network/ClientFactoryImpl.java @@ -31,6 +31,7 @@ import com.nextcloud.common.NextcloudClient; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClientFactory; +import com.owncloud.android.lib.common.OwnCloudClientManagerFactory; import com.owncloud.android.lib.common.accounts.AccountUtils; import java.io.IOException; @@ -46,11 +47,10 @@ class ClientFactoryImpl implements ClientFactory { @Override public OwnCloudClient create(User user) throws CreationException { try { - return OwnCloudClientFactory.createOwnCloudClient(user.toPlatformAccount(), context); + return OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(user.toOwnCloudAccount(), context); } catch (OperationCanceledException| AuthenticatorException| - IOException| - AccountUtils.AccountNotFoundException e) { + IOException e) { throw new CreationException(e); } }