summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-02-24 10:26:26 -0800
committerMichael Kolb <kolby@google.com>2011-02-24 10:26:37 -0800
commitcd424e99aa19d00933e6540a95805042659f596f (patch)
treea309af675fc2af2a8a2bb5ceca14e5692dfcc74c /src
parent29ccf8a32bf65a5512191d3633353132bb2cd88b (diff)
downloadpackages_apps_Browser-cd424e99aa19d00933e6540a95805042659f596f.zip
packages_apps_Browser-cd424e99aa19d00933e6540a95805042659f596f.tar.gz
packages_apps_Browser-cd424e99aa19d00933e6540a95805042659f596f.tar.bz2
fix NPEs after delayed start
Bug: 3476031 Bug: 3480829 add check for valid tab Change-Id: I4430ba2f369125fe263599aa5c8b3460bf6e7ffa
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 8ca151a..da98a1c 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -317,7 +317,10 @@ public class Controller
if (urlData.isEmpty()) {
loadUrl(webView, mSettings.getHomePage());
} else {
- loadUrlDataIn(t, urlData);
+ // monkey protection against delayed start
+ if (t != null) {
+ loadUrlDataIn(t, urlData);
+ }
}
} else {
mTabControl.restoreState(icicle, currentTab, restoreIncognitoTabs,
@@ -2088,9 +2091,12 @@ public class Controller
}
protected void setActiveTab(Tab tab) {
- mTabControl.setCurrentTab(tab);
- // the tab is guaranteed to have a webview after setCurrentTab
- mUi.setActiveTab(tab);
+ // monkey protection against delayed start
+ if (tab != null) {
+ mTabControl.setCurrentTab(tab);
+ // the tab is guaranteed to have a webview after setCurrentTab
+ mUi.setActiveTab(tab);
+ }
}
protected void closeEmptyChildTab() {