summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TabControl.java
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-04-20 13:51:49 -0400
committerPatrick Scott <phanna@android.com>2009-04-20 13:51:49 -0400
commitae641ac4bbe1c7c3fb235774cb84d910573595c7 (patch)
treedc7d353027c8c6af9f0c1eff3679638d25c9ed25 /src/com/android/browser/TabControl.java
parent354bbd00564c91f9989878685a2c5381bb36466e (diff)
downloadpackages_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.java3
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);
}