From 245505bb717c18128e910272f4af4d51adb9c998 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 9 May 2018 19:37:54 +0200 Subject: [PATCH] Fix crash when switching accounts Signed-off-by: Mario Danic --- .../talk/controllers/SwitchAccountController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java index 01f451c4d..2e2a0e129 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java @@ -111,7 +111,14 @@ public class SwitchAccountController extends BaseController { public void onNext(UserEntity userEntity) { cookieManager.getCookieStore().removeAll(); userUtils.disableAllUsersWithoutId(userEntity.getId()); - getRouter().popCurrentController(); + if (getActivity() != null) { + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + getRouter().popCurrentController(); + } + }); + } } @Override