diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-30 15:37:02 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-30 15:37:02 +0200 |
commit | 473866baaf5c736de74cc8b95f8acc84631c1043 (patch) | |
tree | 6f3d7d9e8e2e77261c0cf9dc30db73a4edeea755 /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | f1c0c3e00c7287cdc501cd9148461f4c1ef1d8ec (diff) | |
download | open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.tar.gz open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.tar.bz2 open-keychain-473866baaf5c736de74cc8b95f8acc84631c1043.zip |
instrument: add test for empty clipboard, fix empty clipboard error
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java index 44ca50e6c..779b22535 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java @@ -29,6 +29,7 @@ import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -108,8 +109,9 @@ public class EncryptDecryptOverviewFragment extends Fragment { } final CharSequence clipboardText = ClipboardReflection.getClipboardText(activity); - if (clipboardText == null) { - Notify.create(activity, R.string.error_clipboard_empty, Style.ERROR); + if (clipboardText == null || TextUtils.isEmpty(clipboardText)) { + Notify.create(activity, R.string.error_clipboard_empty, Style.ERROR).show(); + return; } Intent clipboardDecrypt = new Intent(getActivity(), DecryptActivity.class); |