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.
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 @@
* @return index of Tab or -1 if not found
*/
int getTabIndex(Tab tab) {
+ if (tab == null) {
+ return -1;
+ }
return mTabs.indexOf(tab);
}