diff options
author | Patrick Scott <phanna@android.com> | 2009-04-20 13:51:49 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2009-04-20 13:51:49 -0400 |
commit | ae641ac4bbe1c7c3fb235774cb84d910573595c7 (patch) | |
tree | dc7d353027c8c6af9f0c1eff3679638d25c9ed25 /src/com/android/browser/TabControl.java | |
parent | 354bbd00564c91f9989878685a2c5381bb36466e (diff) | |
download | packages_apps_browser-ae641ac4bbe1c7c3fb235774cb84d910573595c7.zip packages_apps_browser-ae641ac4bbe1c7c3fb235774cb84d910573595c7.tar.gz packages_apps_browser-ae641ac4bbe1c7c3fb235774cb84d910573595c7.tar.bz2 |
Check for null before animating the tab/webview.
The tab will most likely not be null but the top window could easily be null if
the tab has been freed due to low memory. Update getTabIndex to return -1 if the
tab is null.
Diffstat (limited to 'src/com/android/browser/TabControl.java')
-rw-r--r-- | src/com/android/browser/TabControl.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index ee63f2c..0cbef69 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -407,6 +407,9 @@ class TabControl { * @return index of Tab or -1 if not found */ int getTabIndex(Tab tab) { + if (tab == null) { + return -1; + } return mTabs.indexOf(tab); } |