diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-02-18 13:19:41 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-02-18 13:19:41 +0100 |
commit | 708d0c9a5ab76219c4ddff73324d814eda5d3873 (patch) | |
tree | 2d9bfe70b17bd568a7f6e15d1f4463fb1b811345 /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service | |
parent | 0597b50258c4cfc9e0af6003b069dadff0d6203d (diff) | |
download | open-keychain-708d0c9a5ab76219c4ddff73324d814eda5d3873.tar.gz open-keychain-708d0c9a5ab76219c4ddff73324d814eda5d3873.tar.bz2 open-keychain-708d0c9a5ab76219c4ddff73324d814eda5d3873.zip |
better error check
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index f6aaffbf6..d765f28cb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -190,7 +190,7 @@ public class OpenPgpService extends RemoteService { long[] keyIds; if (params.containsKey(OpenPgpConstants.PARAMS_KEY_IDS)) { keyIds = params.getLongArray(OpenPgpConstants.PARAMS_KEY_IDS); - } else { + } else if (params.containsKey(OpenPgpConstants.PARAMS_USER_IDS)) { // get key ids based on given user ids String[] userIds = params.getStringArray(OpenPgpConstants.PARAMS_USER_IDS); // give params through to activity... @@ -202,6 +202,12 @@ public class OpenPgpService extends RemoteService { // if not success -> result contains a PendingIntent for user interaction return result; } + } else { + Bundle result = new Bundle(); + result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); + result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + new OpenPgpError(OpenPgpError.GENERIC_ERROR, "Missing parameter user_ids or key_ids!")); + return result; } // add own key for encryption |