Bug 1248695 - Check for null browser app object when handling UI telemetry events; r=snorp

The nsAppShell mBrowserApp object may not have been initialized when
handling UI telemetry events. In that case, we should bail instead of
crashing.
This commit is contained in:
Jim Chen 2016-02-16 16:57:49 -05:00
parent a44d38701c
commit f0b94011a2

View File

@ -655,6 +655,8 @@ nsAppShell::LegacyGeckoEvent::Run()
}
case AndroidGeckoEvent::TELEMETRY_UI_SESSION_STOP: {
if (!nsAppShell::Get()->mBrowserApp)
break;
if (curEvent->Characters().Length() == 0)
break;
@ -672,6 +674,8 @@ nsAppShell::LegacyGeckoEvent::Run()
}
case AndroidGeckoEvent::TELEMETRY_UI_SESSION_START: {
if (!nsAppShell::Get()->mBrowserApp)
break;
if (curEvent->Characters().Length() == 0)
break;
@ -688,6 +692,8 @@ nsAppShell::LegacyGeckoEvent::Run()
}
case AndroidGeckoEvent::TELEMETRY_UI_EVENT: {
if (!nsAppShell::Get()->mBrowserApp)
break;
if (curEvent->Data().Length() == 0)
break;