fix create keyring crash

This commit is contained in:
Ashley Hughes 2014-02-08 15:51:11 +00:00
parent b74ed46434
commit 44ee713763

View File

@ -115,8 +115,8 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
public boolean needsSaving() public boolean needsSaving()
{ {
mNeedsSaving = mUserIdsView.needsSaving(); mNeedsSaving = (mUserIdsView == null) ? false : mUserIdsView.needsSaving();
mNeedsSaving |= mKeysView.needsSaving(); mNeedsSaving |= (mKeysView == null) ? false : mKeysView.needsSaving();
mNeedsSaving |= hasPassphraseChanged(); mNeedsSaving |= hasPassphraseChanged();
return mNeedsSaving; return mNeedsSaving;
} }
@ -515,10 +515,14 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
public boolean hasPassphraseChanged() public boolean hasPassphraseChanged()
{ {
if (mNoPassphrase.isChecked()) { if (mNoPassphrase != null) {
return mIsPassPhraseSet; if (mNoPassphrase.isChecked()) {
} else { return mIsPassPhraseSet;
return (mNewPassPhrase != null && !mNewPassPhrase.equals("")); } else {
return (mNewPassPhrase != null && !mNewPassPhrase.equals(""));
}
}else {
return false;
} }
} }