Prevent NPE in MessageCompose.

New actionBar code makes removeAllTabs() not safe when there are no
tabs.

Change-Id: I9ac09c71872c5f2aaad7b8e3cf5dbe0caac6f8ef
This commit is contained in:
Ben Komalo 2011-05-26 11:14:05 -07:00
parent d89136e037
commit fdfeb8d3c3

View File

@ -1603,7 +1603,10 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
if (shouldUseActionTabs()) {
// Tab-based mode switching.
ActionBar actionBar = getActionBar();
actionBar.removeAllTabs();
if (actionBar.getTabCount() > 0) {
actionBar.removeAllTabs();
}
createAndAddTab(R.string.reply_action, ACTION_REPLY);
createAndAddTab(R.string.reply_all_action, ACTION_REPLY_ALL);
createAndAddTab(R.string.forward_action, ACTION_FORWARD);