fix NPE in EncryptDecryptFragment on empty clipboard
This commit is contained in:
@@ -103,7 +103,7 @@ public class EncryptDecryptFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final CharSequence clipboardText = ClipboardReflection.getClipboardText(activity);
|
final CharSequence clipboardText = ClipboardReflection.getClipboardText(activity);
|
||||||
if (clipboardText == null || TextUtils.isEmpty(clipboardText)) {
|
if (TextUtils.isEmpty(clipboardText)) {
|
||||||
Notify.create(activity, R.string.error_clipboard_empty, Style.ERROR).show();
|
Notify.create(activity, R.string.error_clipboard_empty, Style.ERROR).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -126,6 +126,9 @@ public class EncryptDecryptFragment extends Fragment {
|
|||||||
new AsyncTask<Void, Void, Boolean>() {
|
new AsyncTask<Void, Void, Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(Void... voids) {
|
protected Boolean doInBackground(Void... voids) {
|
||||||
|
if (clipboardText == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// see if it looks like a pgp thing
|
// see if it looks like a pgp thing
|
||||||
Matcher matcher = PgpHelper.PGP_MESSAGE.matcher(clipboardText);
|
Matcher matcher = PgpHelper.PGP_MESSAGE.matcher(clipboardText);
|
||||||
|
|||||||
Reference in New Issue
Block a user