summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TabControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser/TabControl.java')
-rw-r--r--src/com/android/browser/TabControl.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 1be2016..6473c88 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -389,6 +389,11 @@ class TabControl {
// ignore tab
} else if (id == currentId || restoreAll) {
Tab t = createNewTab();
+ if (t == null) {
+ // We could "break" at this point, but we want
+ // sNextId to be set correctly.
+ continue;
+ }
tabMap.put(id, t);
// Me must set the current tab before restoring the state
// so that all the client classes are set.
@@ -416,11 +421,12 @@ class TabControl {
// added the tab to the front as they are not current
mTabQueue.add(0, t);
}
- // make sure that there is no id overlap between the restored
- // and new tabs
- sNextId = maxId + 1;
-
}
+
+ // make sure that there is no id overlap between the restored
+ // and new tabs
+ sNextId = maxId + 1;
+
if (mCurrentTab == -1) {
if (getTabCount() > 0) {
setCurrentTab(getTab(0));