From 7e7a98e80a80a9eee80538e09572766592a48f53 Mon Sep 17 00:00:00 2001 From: Mohamed Zenadi Date: Tue, 25 Jul 2017 18:19:06 +0100 Subject: check that the data we get from OpenKeychain is not null --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index 13e8704b..05b87b98 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -394,6 +394,10 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d(Constants.TAG, "onActivityResult resultCode: " + resultCode); + if (data == null) { + setResult(RESULT_CANCELED, null); + finish(); + } // try again after user interaction if (resultCode == RESULT_OK) { -- cgit v1.2.3