Fix a crash

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-05-07 19:39:04 +02:00
parent f969655f4e
commit 3a58a65bc7

View File

@ -449,35 +449,27 @@ public class AccountVerificationController extends BaseController {
} else { } else {
ApplicationWideMessageHolder.getInstance().setMessageType( ApplicationWideMessageHolder.getInstance().setMessageType(
ApplicationWideMessageHolder.MessageType.FAILED_TO_IMPORT_ACCOUNT); ApplicationWideMessageHolder.MessageType.FAILED_TO_IMPORT_ACCOUNT);
new Handler().postDelayed(() -> { if (getActivity() != null) {
getActivity().runOnUiThread(() -> new Handler().postDelayed(() -> {
if (getRouter().hasRootController()) { if (getRouter().hasRootController()) {
if (getActivity() != null) { if (getActivity() != null) {
getActivity().runOnUiThread(() -> {
getRouter().popToRoot(); getRouter().popToRoot();
});
} }
} else { } else {
if (userUtils.anyUserExists()) { if (userUtils.anyUserExists()) {
if (getActivity() != null) {
getActivity().runOnUiThread(() -> {
getRouter().setRoot(RouterTransaction.with(new MagicBottomNavigationController()) getRouter().setRoot(RouterTransaction.with(new MagicBottomNavigationController())
.pushChangeHandler(new HorizontalChangeHandler()) .pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler())); .popChangeHandler(new HorizontalChangeHandler()));
});
}
} else { } else {
if (getActivity() != null) {
getActivity().runOnUiThread(() -> {
getRouter().setRoot(RouterTransaction.with(new ServerSelectionController()) getRouter().setRoot(RouterTransaction.with(new ServerSelectionController())
.pushChangeHandler(new HorizontalChangeHandler()) .pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler())); .popChangeHandler(new HorizontalChangeHandler()));
});
} }
} }
}, 7500));
} }
}, 7500);
} }
} }