mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
prevent NaN dialog on import with no selected keys
This commit is contained in:
parent
3be44898db
commit
cfeffef80d
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -281,6 +281,7 @@
|
||||
<string name="error_nfc_needed">"NFC must be enabled!"</string>
|
||||
<string name="error_beam_needed">"Beam must be enabled!"</string>
|
||||
<string name="error_nothing_import">"No keys found!"</string>
|
||||
<string name="error_nothing_import_selected">"No keys selected for import!"</string>
|
||||
<string name="error_contacts_key_id_missing">"Retrieving the key ID from contacts failed!"</string>
|
||||
<string name="error_generic_report_bug">"A generic error occurred, please create a new bug report for OpenKeychain."</string>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user