Fix account removal if it’s the last account

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-04-18 01:56:14 +02:00
parent b335d34e18
commit b7dec6e4fa

View File

@ -406,19 +406,12 @@ 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) { getRouter().setRoot(RouterTransaction.with(
if (getActivity() != null) {
// Something went very wrong, finish the app
getActivity().finish();
}
} else {
getParentController().getRouter().setRoot(RouterTransaction.with(
new ServerSelectionController()) new ServerSelectionController())
.pushChangeHandler(new VerticalChangeHandler()) .pushChangeHandler(new VerticalChangeHandler())
.popChangeHandler(new VerticalChangeHandler())); .popChangeHandler(new VerticalChangeHandler()));
} }
} }
}
@Override @Override
protected void onAttach(@NonNull View view) { protected void onAttach(@NonNull View view) {