fixed npe in paste as quote
This commit is contained in:
parent
1cc3f5bed7
commit
59697eb092
|
@ -72,8 +72,8 @@ public class EditMessageActionModeCallback implements ActionMode.Callback {
|
||||||
@Override
|
@Override
|
||||||
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
||||||
if (item.getItemId() == R.id.paste_as_quote) {
|
if (item.getItemId() == R.id.paste_as_quote) {
|
||||||
ClipData primaryClip = clipboardManager.getPrimaryClip();
|
final ClipData primaryClip = clipboardManager.getPrimaryClip();
|
||||||
if (primaryClip.getItemCount() >= 1) {
|
if (primaryClip != null && primaryClip.getItemCount() >= 1) {
|
||||||
editMessage.insertAsQuote(primaryClip.getItemAt(0).getText().toString());
|
editMessage.insertAsQuote(primaryClip.getItemAt(0).getText().toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue