aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Zenadi <mohamed@zenadi.com>2015-03-17 19:09:25 +0100
committerMohamed Zenadi <mohamed@zenadi.com>2015-03-17 19:10:27 +0100
commita75048e20136bc5f8531380c114456463ac63fa9 (patch)
tree7186d1b75a151cef3b7aa7a1c1a961c152b377b8
parentb691c4c98cbd05d6d04eb668867c3bfcc31cbe4b (diff)
check that the data we get is not nullv1.2.0.14
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
index 199d1172..48175167 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
@@ -154,6 +154,9 @@ public class UserPreference extends ActionBarActivity implements Preference.OnPr
case IMPORT_SSH_KEY:
{
try {
+ if (data.getData() == null) {
+ throw new IOException("Unable to open file");
+ }
copySshKey(data.getData());
Toast.makeText(this, this.getResources().getString(R.string.ssh_key_success_dialog_title), Toast.LENGTH_LONG).show();
setResult(RESULT_OK);