Bug 1346019 - Guard against null GeckoApp in GeckoUpdateReceiver; r=me

Don't dispatch the "Update:CheckResult" event if we don't have an active
GeckoApp. r=me for trivial patch.
This commit is contained in:
Jim Chen 2017-03-10 13:48:07 -05:00
Родитель d273437717
Коммит e6b653c89a
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -17,6 +17,9 @@ public class GeckoUpdateReceiver extends BroadcastReceiver
@Override
public void onReceive(Context context, Intent intent) {
if (UpdateServiceHelper.ACTION_CHECK_UPDATE_RESULT.equals(intent.getAction())) {
if (GeckoAppShell.getGeckoInterface() == null) {
return;
}
final GeckoBundle data = new GeckoBundle(1);
data.putString("result", intent.getStringExtra("result"));
GeckoApp.getEventDispatcher().dispatch("Update:CheckResult", data);