fixed npe in paste as quote

This commit is contained in:
Daniel Gultsch 2018-07-06 20:16:15 +02:00
parent 1cc3f5bed7
commit 59697eb092

View file

@ -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;
}