diff options
author | Michael Kolb <kolby@google.com> | 2011-02-24 10:26:26 -0800 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-02-24 10:26:37 -0800 |
commit | cd424e99aa19d00933e6540a95805042659f596f (patch) | |
tree | a309af675fc2af2a8a2bb5ceca14e5692dfcc74c /src | |
parent | 29ccf8a32bf65a5512191d3633353132bb2cd88b (diff) | |
download | packages_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.java | 14 |
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() { |