Put the null-check *before* the crash it's supposed to prevent (which timeless saw, somehow).

git-svn-id: svn://10.0.0.236/trunk@168616 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org 2005-02-01 07:35:20 +00:00
parent c1e56cf542
commit 16f4991e84

View File

@ -2120,12 +2120,14 @@ nsTextControlFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
nsPresContext* presContext = aState.PresContext();
const nsHTMLReflowState* reflowState = aState.GetReflowState();
nsSize styleSize(CSS_NOTSET,CSS_NOTSET);
nsFormControlFrame::GetStyleSize(presContext, *reflowState, styleSize);
// XXXldb Is there a good reason to think this is both non-null and the
// correct reflow state?
if (!reflowState)
return NS_OK;
nsSize styleSize(CSS_NOTSET,CSS_NOTSET);
nsFormControlFrame::GetStyleSize(presContext, *reflowState, styleSize);
if (mState & NS_FRAME_FIRST_REFLOW)
mNotifyOnInput = PR_TRUE; //its ok to notify now. all has been prepared.