avoid possible NPE (#471)

This commit is contained in:
m2049r 2018-11-13 22:32:31 +01:00 committed by GitHub
parent be04185481
commit 38a825d580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -438,8 +438,10 @@ public class Helper {
if (result) { if (result) {
Helper.hideKeyboardAlways((Activity) context); Helper.hideKeyboardAlways((Activity) context);
cancelSignal.cancel(); cancelSignal.cancel();
if (openDialog != null) { // maybe it was cancelled in the meantime
openDialog.dismiss(); openDialog.dismiss();
openDialog = null; openDialog = null;
}
} else { } else {
if (fingerprintUsed) { if (fingerprintUsed) {
incorrectSavedPass.set(true); incorrectSavedPass.set(true);
@ -458,7 +460,6 @@ public class Helper {
etPassword.setError(context.getString(R.string.bad_password)); etPassword.setError(context.getString(R.string.bad_password));
} }
} }
loginTask = null; loginTask = null;
} }
} }