Bug 1611505. Remove now-unnecessary null-checks. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D61007

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2020-01-26 14:10:26 +00:00
parent a54705b862
commit 2f0e749001

View File

@ -428,18 +428,15 @@ bool nsScriptErrorBase::ComputeIsFromPrivateWindow(
nsGlobalWindowInner* aWindow) {
// Never mark exceptions from chrome windows as having come from private
// windows, since we always want them to be reported.
// winPrincipal needs to be null-checked - Bug 1601175
nsIPrincipal* winPrincipal = aWindow->GetPrincipal();
return aWindow->IsPrivateBrowsing() &&
(!winPrincipal || !winPrincipal->IsSystemPrincipal());
return aWindow->IsPrivateBrowsing() && !winPrincipal->IsSystemPrincipal();
}
/* static */
bool nsScriptErrorBase::ComputeIsFromChromeContext(
nsGlobalWindowInner* aWindow) {
nsIPrincipal* winPrincipal = aWindow->GetPrincipal();
// winPrincipal needs to be null-checked - Bug 1601175
return (winPrincipal && winPrincipal->IsSystemPrincipal());
return winPrincipal->IsSystemPrincipal();
}
NS_IMPL_ISUPPORTS(nsScriptError, nsIConsoleMessage, nsIScriptError)