Fix a crash in Mac embedding apps: HasGfxScrollBars() checks for null pointer after calling GetPrefs().

This commit is contained in:
pierre%netscape.com 1999-10-19 03:00:47 +00:00
parent 9253dd3ab3
commit ef97bb93d1
2 changed files with 6 additions and 2 deletions

View File

@ -3317,7 +3317,9 @@ nsCSSFrameConstructor::HasGfxScrollbars(nsIPresContext* aPresContext)
nsCOMPtr<nsIPref> pref;
aPresContext->GetPrefs(getter_AddRefs(pref));
PRBool gfx = PR_FALSE;
pref->GetBoolPref("nglayout.widget.gfxscrollbars", &gfx);
if (pref) {
pref->GetBoolPref("nglayout.widget.gfxscrollbars", &gfx);
}
return gfx;

View File

@ -3317,7 +3317,9 @@ nsCSSFrameConstructor::HasGfxScrollbars(nsIPresContext* aPresContext)
nsCOMPtr<nsIPref> pref;
aPresContext->GetPrefs(getter_AddRefs(pref));
PRBool gfx = PR_FALSE;
pref->GetBoolPref("nglayout.widget.gfxscrollbars", &gfx);
if (pref) {
pref->GetBoolPref("nglayout.widget.gfxscrollbars", &gfx);
}
return gfx;