Fix for bug #13780. Added NULL pointer check to PreferenceChanged()

This commit is contained in:
troy%netscape.com 1999-09-14 22:16:42 +00:00
parent 987374301c
commit f521d3ac1b
2 changed files with 36 additions and 30 deletions

View File

@ -244,13 +244,15 @@ nsPresContext::PreferenceChanged(const char* aPrefName)
// Initialize our state from the user preferences
GetUserPreferences();
if (mShell) {
// Have the root frame's style context remap its style based on the
// user preferences
nsIFrame* rootFrame;
nsIStyleContext* rootStyleContext;
mShell->GetRootFrame(&rootFrame);
if (nsnull != rootFrame) {
if (rootFrame) {
nsIStyleContext* rootStyleContext;
rootFrame->GetStyleContext(&rootStyleContext);
rootStyleContext->RemapStyle(this);
NS_RELEASE(rootStyleContext);
@ -261,6 +263,7 @@ nsPresContext::PreferenceChanged(const char* aPrefName)
// then we only need to repaint...
mShell->StyleChangeReflow();
}
}
}
NS_IMETHODIMP

View File

@ -244,13 +244,15 @@ nsPresContext::PreferenceChanged(const char* aPrefName)
// Initialize our state from the user preferences
GetUserPreferences();
if (mShell) {
// Have the root frame's style context remap its style based on the
// user preferences
nsIFrame* rootFrame;
nsIStyleContext* rootStyleContext;
mShell->GetRootFrame(&rootFrame);
if (nsnull != rootFrame) {
if (rootFrame) {
nsIStyleContext* rootStyleContext;
rootFrame->GetStyleContext(&rootStyleContext);
rootStyleContext->RemapStyle(this);
NS_RELEASE(rootStyleContext);
@ -261,6 +263,7 @@ nsPresContext::PreferenceChanged(const char* aPrefName)
// then we only need to repaint...
mShell->StyleChangeReflow();
}
}
}
NS_IMETHODIMP