diff options
author | Ashley Hughes <spirit.returned@gmail.com> | 2014-02-08 15:51:11 +0000 |
---|---|---|
committer | Ashley Hughes <spirit.returned@gmail.com> | 2014-02-08 15:51:11 +0000 |
commit | 44ee7137632c2fd8e6d97a8f05a213467ecf1dc6 (patch) | |
tree | c46939b499a5de578740f0a8119e8ceb8b44dc62 | |
parent | b74ed4643453cd089ec885bb3f56169629f8cacf (diff) | |
download | open-keychain-44ee7137632c2fd8e6d97a8f05a213467ecf1dc6.tar.gz open-keychain-44ee7137632c2fd8e6d97a8f05a213467ecf1dc6.tar.bz2 open-keychain-44ee7137632c2fd8e6d97a8f05a213467ecf1dc6.zip |
fix create keyring crash
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 66f23e22e..802d29a44 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -115,8 +115,8 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener public boolean needsSaving() { - mNeedsSaving = mUserIdsView.needsSaving(); - mNeedsSaving |= mKeysView.needsSaving(); + mNeedsSaving = (mUserIdsView == null) ? false : mUserIdsView.needsSaving(); + mNeedsSaving |= (mKeysView == null) ? false : mKeysView.needsSaving(); mNeedsSaving |= hasPassphraseChanged(); return mNeedsSaving; } @@ -515,10 +515,14 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener public boolean hasPassphraseChanged() { - if (mNoPassphrase.isChecked()) { - return mIsPassPhraseSet; - } else { - return (mNewPassPhrase != null && !mNewPassPhrase.equals("")); + if (mNoPassphrase != null) { + if (mNoPassphrase.isChecked()) { + return mIsPassPhraseSet; + } else { + return (mNewPassPhrase != null && !mNewPassPhrase.equals("")); + } + }else { + return false; } } |