mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 766865 - java.lang.IndexOutOfBoundsException in TabsTray.addTab [r=margaret]
This commit is contained in:
parent
bd2298240c
commit
1e762c47df
@ -134,6 +134,10 @@ public class TabsTray extends LinearLayout
|
||||
|
||||
int index = Tabs.getInstance().getIndexOf(tab);
|
||||
if (msg == Tabs.TabEvents.ADDED) {
|
||||
if (index == -1) // If the tab has already been removed, do nothing.
|
||||
return;
|
||||
if (index > mTabsAdapter.getCount())
|
||||
index = mTabsAdapter.getCount();
|
||||
mTabsAdapter.addTab(index, tab);
|
||||
mTabsAdapter.notifyDataSetChanged();
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user