From 1d0609d386cbaeb986cd14bbd849940052dba39b Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 17 Jul 2011 17:24:51 -0700 Subject: [PATCH] Don't allow actions on empty sets * Not sure how this could have happened, except possibly for some race condition * Let's make sure it's impossible Bug: 5032454 Change-Id: Ibd4de22dc5298fbaaf224cf4286f63bdc50aa7b9 --- src/com/android/email/activity/MessageListFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index a426af7b4..12a9650f0 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -1375,6 +1375,7 @@ public class MessageListFragment extends ListFragment @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { Set selectedConversations = mListAdapter.getSelectedSet(); + if (selectedConversations.isEmpty()) return true; switch (item.getItemId()) { case R.id.mark_read: // Note - marking as read does not trigger auto-advance.