diff options
author | Michael Kolb <kolby@google.com> | 2010-12-06 10:18:26 -0800 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2010-12-06 15:28:06 -0800 |
commit | 06f03e45b6adfa8aed9eca65aec6ed87dc1ca8f6 (patch) | |
tree | 0ea74f1ce72fc8585fcb98c4480a659592d12c6e | |
parent | 3a696280cba53eea153c9d5707b236997d193328 (diff) | |
download | packages_apps_Browser-06f03e45b6adfa8aed9eca65aec6ed87dc1ca8f6.zip packages_apps_Browser-06f03e45b6adfa8aed9eca65aec6ed87dc1ca8f6.tar.gz packages_apps_Browser-06f03e45b6adfa8aed9eca65aec6ed87dc1ca8f6.tar.bz2 |
fix NPE in onDestroy
Bug 3255996
In case of a search we might exit the browser without ever creating a
controller; added check to lifecycle methods.
Change-Id: I5fc358c31263ff63297a18944dce230f48886628
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 1c15153..7c0f7c8 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -130,7 +130,9 @@ public class BrowserActivity extends Activity { if (LOGV_ENABLED) { Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this); } - mController.onResume(); + if (mController != null) { + mController.onResume(); + } } @Override @@ -167,7 +169,9 @@ public class BrowserActivity extends Activity { @Override protected void onPause() { - mController.onPause(); + if (mController != null) { + mController.onPause(); + } super.onPause(); } @@ -177,7 +181,9 @@ public class BrowserActivity extends Activity { Log.v(LOGTAG, "BrowserActivity.onDestroy: this=" + this); } super.onDestroy(); - mController.onDestroy(); + if (mController != null) { + mController.onDestroy(); + } mUi = null; mController = null; } |