Check action mode is still valid.

Due to support library bug, onActionItemClicked can be called after finish/onDestroyActionMode so we can check for that by checking if our reference to the action mode is still valid.

Fixes #8891
This commit is contained in:
Alan Evans 2019-06-27 15:44:05 -04:00 committed by GitHub
parent c089d6cd43
commit 0f3de6c979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1054,6 +1054,8 @@ public class ConversationFragment extends Fragment
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
if (actionMode == null) return false;
switch(item.getItemId()) {
case R.id.menu_context_copy:
handleCopyMessage(getListAdapter().getSelectedItems());