From 6f57abd3d6c5ae7af4f804dfbe5ab9d4b854b5c6 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 9 Jul 2018 22:12:44 +0200 Subject: fixed npe in paste as quote --- .../de/pixart/messenger/ui/util/EditMessageActionModeCallback.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java index d22db8fa9..cb50e4164 100644 --- a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java +++ b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java @@ -70,8 +70,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; } -- cgit v1.2.3