Bug 742481 - Fix NPE in GeckoActivity.checkIfGeckoActivity. r=sriram,mfinkle

This commit is contained in:
Wes Johnston 2012-04-04 13:28:17 -07:00
parent 2d90b862c2
commit 2f4819dd4f

View File

@ -54,13 +54,12 @@ public class GeckoActivity extends Activity {
// 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@"))
if (component != null &&
component.getPackageName() != null &&
component.getPackageName().equals("@ANDROID_PACKAGE_NAME@")) {
isGeckoActivityOpened = true;
else
isGeckoActivityOpened = false;
}
}
public boolean isApplicationInBackground() {