bug 671799 - check whether mURI is null during @font-face console logging. r=jdaggett
authorJonathan Kew <jfkthame@gmail.com>
Fri, 15 Jul 2011 15:16:24 +0100
changeset 72868 911439385a906680ad7c61234f6d9513d716bc84
parent 72867 eb3a8761eac6e7f6f320b48304b464ee82ab6129
child 72869 85b1015168a041ea87ee6acc7548d2a25d095bb6
push id20778
push userjkew@mozilla.com
push dateFri, 15 Jul 2011 14:19:07 +0000
treeherdermozilla-central@911439385a90 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs671799
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 671799 - check whether mURI is null during @font-face console logging. r=jdaggett
layout/style/nsFontFaceLoader.cpp
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -718,17 +718,21 @@ nsUserFontSet::LogMessage(gfxProxyFontEn
   nsCOMPtr<nsIConsoleService>
     console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
   if (!console) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   NS_ConvertUTF16toUTF8 familyName(aProxy->FamilyName());
   nsCAutoString fontURI;
-  aProxy->mSrcList[aProxy->mSrcIndex].mURI->GetSpec(fontURI);
+  if (aProxy->mSrcList[aProxy->mSrcIndex].mURI) {
+    aProxy->mSrcList[aProxy->mSrcIndex].mURI->GetSpec(fontURI);
+  } else {
+    fontURI.AppendLiteral("(invalid URI)");
+  }
 
   char weightKeywordBuf[8]; // plenty to sprintf() a PRUint16
   const char *weightKeyword;
   const nsAFlatCString& weightKeywordString =
     nsCSSProps::ValueToKeyword(aProxy->Weight(),
                                nsCSSProps::kFontWeightKTable);
   if (weightKeywordString.Length() > 0) {
     weightKeyword = weightKeywordString.get();