Bug 742481 - Fix NPE in GeckoActivity.checkIfGeckoActivity. r=sriram,mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Wed, 04 Apr 2012 13:28:17 -0700
changeset 94336 2a15dd9391197b44f203d844a725df6844bc8e7a
parent 94335 a1eb00dcb958d20000ac860de386c6eeff06f8b8
child 94337 48cb615fbcb5a46623ef45f7eb89754a69fd0d02
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram, mfinkle
bugs742481
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 742481 - Fix NPE in GeckoActivity.checkIfGeckoActivity. r=sriram,mfinkle
mobile/android/base/GeckoActivity.java.in
--- a/mobile/android/base/GeckoActivity.java.in
+++ b/mobile/android/base/GeckoActivity.java.in
@@ -49,21 +49,20 @@ public class GeckoActivity extends Activ
         super.startActivityForResult(intent, request);
     }
 
     private void checkIfGeckoActivity(Intent intent) {
         // Whenever we call our own activity, the component and it's package name is set.
         // If we call an activity from another package, or an open intent (leaving android to resolve)
         // component has a different package name or it is null.
         ComponentName component = intent.getComponent();
-        if (component == null)
-            isGeckoActivityOpened = false;
-
-        if (component.getPackageName().equals("@ANDROID_PACKAGE_NAME@"))
+        isGeckoActivityOpened = false;
+        if (component != null &&
+            component.getPackageName() != null &&
+            component.getPackageName().equals("@ANDROID_PACKAGE_NAME@")) {
             isGeckoActivityOpened = true;
-        else
-            isGeckoActivityOpened = false;
+        }
     }
 
     public boolean isApplicationInBackground() {
         return !isGeckoActivityOpened;
     } 
 }