Explorar o código

Fix account removal if it’s the last account

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic %!s(int64=6) %!d(string=hai) anos
pai
achega
b7dec6e4fa

+ 4 - 11
app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java

@@ -406,17 +406,10 @@ public class SettingsController extends BaseController {
             onViewBound(getView());
             onViewBound(getView());
             onAttach(getView());
             onAttach(getView());
         } else if (!otherUserExists) {
         } else if (!otherUserExists) {
-            if (getParentController() == null || getParentController().getRouter() == null) {
-                if (getActivity() != null) {
-                    // Something went very wrong, finish the app
-                    getActivity().finish();
-                }
-            } else {
-                getParentController().getRouter().setRoot(RouterTransaction.with(
-                        new ServerSelectionController())
-                        .pushChangeHandler(new VerticalChangeHandler())
-                        .popChangeHandler(new VerticalChangeHandler()));
-            }
+            getRouter().setRoot(RouterTransaction.with(
+                    new ServerSelectionController())
+                    .pushChangeHandler(new VerticalChangeHandler())
+                    .popChangeHandler(new VerticalChangeHandler()));
         }
         }
     }
     }