Bug 813705 - Initialize nsresult value before possibly using it. r=roc
authorJosh Matthews <josh@joshmatthews.net>
Tue, 20 Nov 2012 15:59:36 -0500
changeset 122918 cc266c0b96aaad6a23caa0ec1ca59cb658d86906
parent 122917 e977d28f124389a74a6895507758344b79ff8ff1
child 122919 86b0762e70edb17d863eae09e7abddbcea3b351d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs813705
milestone20.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 813705 - Initialize nsresult value before possibly using it. r=roc
layout/base/nsPresContext.cpp
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -409,17 +409,17 @@ static bool sLookAndFeelChanged;
 // one prescontext.
 static bool sThemeChanged;
 
 const nsPresContext::LangGroupFontPrefs*
 nsPresContext::GetFontPrefsForLang(nsIAtom *aLanguage) const
 {
   // Get language group for aLanguage:
 
-  nsresult rv;
+  nsresult rv = NS_OK;
   nsIAtom *langGroupAtom = nullptr;
   if (!aLanguage) {
     aLanguage = mLanguage;
   }
   if (aLanguage && mLangService) {
     langGroupAtom = mLangService->GetLanguageGroup(aLanguage, &rv);
   }
   if (NS_FAILED(rv) || !langGroupAtom) {