summaryrefslogtreecommitdiff
path: root/src/com/android/browser/BrowserActivity.java
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-06-22 11:46:06 -0400
committerPatrick Scott <phanna@android.com>2009-06-22 11:46:06 -0400
commitd068f8015daa84296463fcc0420e40e35e40fe7d (patch)
treede47259a26183eaacf691f964ab9623c0876d108 /src/com/android/browser/BrowserActivity.java
parentd8b0ad28ce8a3a6b5dfab954e4f7aa7b0af2674f (diff)
Fix 2 NPEs in the Browser.
The first was from freeMemory getting a tab back that had already been freed. This is a really hard case to reproduce but it appears that it can happen. So just check for a null mMainView before trying to free the tab. The second was a null mTabOverview during the onAnimationStart method when animating to the tab overview. I think this is caused by message delays not being accurate enough to ensure the overview has been created. A check for null fixes the problem for now but I am working on a better solution to ensure animation message order.
Diffstat (limited to 'src/com/android/browser/BrowserActivity.java')
-rw-r--r--src/com/android/browser/BrowserActivity.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8fb853fd..eae24f1a 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -2112,10 +2112,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) {