diff options
author | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-05-31 02:36:45 +0530 |
---|---|---|
committer | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-05-31 02:36:45 +0530 |
commit | cfeffef80d8c204aba90b477741128f297fcad06 (patch) | |
tree | f77839e53470ba51956606a062e4273e0bf276dd /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 3be44898db2afd1fd993553e228efaac94f14120 (diff) | |
download | open-keychain-cfeffef80d8c204aba90b477741128f297fcad06.tar.gz open-keychain-cfeffef80d8c204aba90b477741128f297fcad06.tar.bz2 open-keychain-cfeffef80d8c204aba90b477741128f297fcad06.zip |
prevent NaN dialog on import with no selected keys
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index ee57dd319..d02030cbf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -384,6 +384,13 @@ public class ImportKeysActivity extends BaseNfcActivity { */ public void importKeys() { ImportKeysListFragment.LoaderState ls = mListFragment.getLoaderState(); + + if (mListFragment.getSelectedEntries().size() == 0) { + Notify.create(this, R.string.error_nothing_import_selected, Notify.Style.ERROR) + .show((ViewGroup) findViewById(R.id.import_snackbar)); + return; + } + if (ls instanceof ImportKeysListFragment.BytesLoaderState) { Log.d(Constants.TAG, "importKeys started"); @@ -488,9 +495,6 @@ public class ImportKeysActivity extends BaseNfcActivity { // start service with intent startService(intent); - } else { - Notify.create(this, R.string.error_nothing_import, Notify.Style.ERROR) - .show((ViewGroup) findViewById(R.id.import_snackbar)); } } |