From 59697eb092ca58c4c6e739cc785f900eb60bce03 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 6 Jul 2018 20:16:15 +0200 Subject: [PATCH] fixed npe in paste as quote --- .../conversations/ui/util/EditMessageActionModeCallback.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/util/EditMessageActionModeCallback.java b/src/main/java/eu/siacs/conversations/ui/util/EditMessageActionModeCallback.java index 621c86822..54cf30927 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/EditMessageActionModeCallback.java +++ b/src/main/java/eu/siacs/conversations/ui/util/EditMessageActionModeCallback.java @@ -72,8 +72,8 @@ public class EditMessageActionModeCallback implements ActionMode.Callback { @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { if (item.getItemId() == R.id.paste_as_quote) { - ClipData primaryClip = clipboardManager.getPrimaryClip(); - if (primaryClip.getItemCount() >= 1) { + final ClipData primaryClip = clipboardManager.getPrimaryClip(); + if (primaryClip != null && primaryClip.getItemCount() >= 1) { editMessage.insertAsQuote(primaryClip.getItemAt(0).getText().toString()); return true; }