diff options
| author | Narayan Kamath <narayan@google.com> | 2011-07-20 11:20:47 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-20 11:20:47 -0700 |
| commit | 3b02d34b1f3c6c1629f23b9ffcb372fbf2f1d880 (patch) | |
| tree | e3844b899e18032dccba1e0bbcd2beffda431d37 | |
| parent | c8892c7975dee647c65b52fb9350e5c3858bcf8b (diff) | |
| parent | 79e5d8d14609a2d5bc5cac8daf7cad1cc9a98d4e (diff) | |
| download | packages_apps_Browser-3b02d34b1f3c6c1629f23b9ffcb372fbf2f1d880.tar.gz packages_apps_Browser-3b02d34b1f3c6c1629f23b9ffcb372fbf2f1d880.tar.bz2 packages_apps_Browser-3b02d34b1f3c6c1629f23b9ffcb372fbf2f1d880.zip | |
Merge "Fixes an NPE observed during state restoration."
| -rw-r--r-- | src/com/android/browser/TabControl.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index 1be2016ac..6473c8867 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)); |
