aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-07-09 22:12:44 +0200
committerChristian Schneppe <christian@pix-art.de>2018-07-09 22:12:44 +0200
commit6f57abd3d6c5ae7af4f804dfbe5ab9d4b854b5c6 (patch)
treedbfced03aa9e4e6f6d0245d1504b5626ea6e4913 /src/main/java/de
parente4a9cecddab5fd53d30c49fe759788d2a5f74ad0 (diff)
fixed npe in paste as quote
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java4
1 files changed, 2 insertions, 2 deletions
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;
}