aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-02-14 02:41:27 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-02-14 02:41:27 +0100
commitee2fec17597c35ad2329f44cc697e18e3e4169cc (patch)
tree2121e250e4df6eb0be1447333c14ad4946094965 /OpenPGP-Keychain
parent7939aaaa440f84a0df5524f8a1a1c04dd569eedd (diff)
downloadopen-keychain-ee2fec17597c35ad2329f44cc697e18e3e4169cc.tar.gz
open-keychain-ee2fec17597c35ad2329f44cc697e18e3e4169cc.tar.bz2
open-keychain-ee2fec17597c35ad2329f44cc697e18e3e4169cc.zip
fix nullpointer
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java10
1 files changed, 9 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 9cdb12eda..006754bae 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
@@ -522,9 +522,17 @@ public class OpenPgpService extends RemoteService {
public Bundle sign(Bundle params, final ParcelFileDescriptor input, final ParcelFileDescriptor output) {
final AppSettings appSettings = getAppSettings();
- Bundle result = new Bundle();
+ if (params == null) {
+ Bundle result = new Bundle();
+ OpenPgpError error = new OpenPgpError(OpenPgpError.GENERIC_ERROR, "params Bundle required!");
+ result.putParcelable(OpenPgpConstants.RESULT_ERRORS, error);
+ result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR);
+ return result;
+ }
+
if (params.getInt(OpenPgpConstants.PARAMS_API_VERSION) != OpenPgpConstants.API_VERSION) {
// not compatible!
+ Bundle result = new Bundle();
OpenPgpError error = new OpenPgpError(OpenPgpError.INCOMPATIBLE_API_VERSIONS, "Incompatible API versions!");
result.putParcelable(OpenPgpConstants.RESULT_ERRORS, error);
result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR);