Bug 1075617 followup to fix crash when rule is null.

This commit is contained in:
Boris Zbarsky 2014-10-02 02:06:39 -04:00
parent 34de660675
commit 7158f29c71

View File

@ -1055,6 +1055,8 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
nsString href;
nsString text;
nsresult rv;
uint32_t line = 0;
uint32_t column = 0;
if (rule) {
rv = rule->GetCssText(text);
NS_ENSURE_SUCCESS(rv, rv);
@ -1069,6 +1071,8 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
NS_WARNING("null parent stylesheet for @font-face rule");
href.AssignLiteral("unknown");
}
line = rule->GetLineNumber();
column = rule->GetColumnNumber();
}
nsCOMPtr<nsIScriptError> scriptError =
@ -1079,8 +1083,8 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
rv = scriptError->InitWithWindowID(NS_ConvertUTF8toUTF16(message),
href, // file
text, // src line
rule->GetLineNumber(),
rule->GetColumnNumber(),
line,
column,
aFlags, // flags
"CSS Loader", // category (make separate?)
innerWindowID);