From a12b67c538a1934a35c45fbed3569056a786df67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Tue, 4 Mar 2014 13:56:46 +0100 Subject: Added exception is null option to display nothing if no error occured --- .../sufficientlysecure/keychain/ui/ImportKeysListFragment.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index 06925e5fa..a6917d6f4 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -225,14 +225,16 @@ public class ImportKeysListFragment extends ListFragment implements switch (loader.getId()) { case LOADER_ID_BYTES: - if(error instanceof ImportKeysListLoader.FileHasNoContent) { + if(error == null){ + // No error + } else if(error instanceof ImportKeysListLoader.FileHasNoContent) { AppMsg.makeText(getActivity(), R.string.error_import_file_no_content, AppMsg.STYLE_ALERT).show(); - } else if(error instanceof ImportKeysListLoader.NonPGPPart) { + } else if(error instanceof ImportKeysListLoader.NonPgpPart) { AppMsg.makeText(getActivity(), - ((ImportKeysListLoader.NonPGPPart) error).getCount() + " " + getResources(). + ((ImportKeysListLoader.NonPgpPart) error).getCount() + " " + getResources(). getQuantityString(R.plurals.error_import_non_pgp_part, - ((ImportKeysListLoader.NonPGPPart) error).getCount()), + ((ImportKeysListLoader.NonPgpPart) error).getCount()), new AppMsg.Style(AppMsg.LENGTH_LONG, R.color.confirm)).show(); } else { AppMsg.makeText(getActivity(), R.string.error_generic_report_bug, -- cgit v1.2.3