summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/browser/BrowserActivity.java10
-rw-r--r--src/com/android/browser/TabControl.java5
2 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index d1d8d15..ef484b0 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -2187,10 +2187,12 @@ public class BrowserActivity extends Activity
final Animation.AnimationListener l =
new Animation.AnimationListener() {
public void onAnimationStart(Animation a) {
- mTabOverview.requestFocus();
- // Clear the listener so we don't trigger a tab
- // selection.
- mTabOverview.setListener(null);
+ if (mTabOverview != null) {
+ mTabOverview.requestFocus();
+ // Clear the listener so we don't trigger a tab
+ // selection.
+ mTabOverview.setListener(null);
+ }
}
public void onAnimationRepeat(Animation a) {}
public void onAnimationEnd(Animation a) {
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index f66df69..bdb57fa 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -712,8 +712,9 @@ class TabControl {
t = mTabQueue.get(i++);
} while (i < queueSize && t != null && t.mMainView == null);
- // Don't do anything if the last remaining tab is the current one.
- if (t == getCurrentTab()) {
+ // Don't do anything if the last remaining tab is the current one or if
+ // the last tab has been freed already.
+ if (t == getCurrentTab() || t.mMainView == null) {
return null;
}