Fix crash in CredentialsPreference

This commit is contained in:
Jakob Nixdorf 2018-01-04 12:34:59 +01:00
parent 5059abf2d0
commit a3a285bebc
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC

View file

@ -222,7 +222,8 @@ public class CredentialsPreference extends DialogPreference
if (value == AuthMethod.NONE) {
credentialsLayout.setVisibility(View.GONE);
UIHelper.hideKeyboard(getContext(), getDialog().getCurrentFocus());
if (getDialog() != null)
UIHelper.hideKeyboard(getContext(), getDialog().getCurrentFocus());
btnSave.setEnabled(true);
} else if (value == AuthMethod.PASSWORD) {
@ -260,7 +261,8 @@ public class CredentialsPreference extends DialogPreference
} else if (value == AuthMethod.DEVICE) {
credentialsLayout.setVisibility(View.GONE);
UIHelper.hideKeyboard(getContext(), getDialog().getCurrentFocus());
if (getDialog() != null)
UIHelper.hideKeyboard(getContext(), getDialog().getCurrentFocus());
btnSave.setEnabled(true);
}