diff options
author | Ashley Hughes <spirit.returned@gmail.com> | 2014-01-15 22:37:23 +0000 |
---|---|---|
committer | Ashley Hughes <spirit.returned@gmail.com> | 2014-01-16 10:04:28 +0000 |
commit | 09caba36a00d74d593801f8a09b11fb600015828 (patch) | |
tree | 4fdb347d6e78945e6fb27643c9a2cab038013423 /OpenPGP-Keychain/src/org | |
parent | 9c0432d24c6aae6fb9420229666a9d1d60d95972 (diff) | |
download | open-keychain-09caba36a00d74d593801f8a09b11fb600015828.tar.gz open-keychain-09caba36a00d74d593801f8a09b11fb600015828.tar.bz2 open-keychain-09caba36a00d74d593801f8a09b11fb600015828.zip |
fix clipboard null crash
Diffstat (limited to 'OpenPGP-Keychain/src/org')
2 files changed, 6 insertions, 4 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/compatibility/ClipboardReflection.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/compatibility/ClipboardReflection.java index 69415c4c2..704448e47 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/compatibility/ClipboardReflection.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/compatibility/ClipboardReflection.java @@ -50,7 +50,7 @@ public class ClipboardReflection { methodNewPlainText.invoke(clipboard, clip); } } catch (Exception e) { - Log.e("ProjectsException", "There was and error copying the text to the clipboard: " + Log.e("ProjectsException", "There was an error copying the text to the clipboard: " + e.getMessage()); } } @@ -89,7 +89,7 @@ public class ClipboardReflection { return null; } } catch (Exception e) { - Log.e("ProjectsException", "There was and error getting the text from the clipboard: " + Log.e("ProjectsException", "There was an error getting the text from the clipboard: " + e.getMessage()); return null; diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ImportKeysClipboardFragment.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ImportKeysClipboardFragment.java index 31f758395..04671587a 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ImportKeysClipboardFragment.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ImportKeysClipboardFragment.java @@ -59,8 +59,10 @@ public class ImportKeysClipboardFragment extends Fragment { @Override public void onClick(View v) { CharSequence clipboardText = ClipboardReflection.getClipboardText(getActivity()); - - mImportActivity.loadCallback(clipboardText.toString().getBytes(), null); + String sendText = ""; + if (clipboardText != null) + sendText = clipboardText.toString(); + mImportActivity.loadCallback(sendText.getBytes(), null); } }); |