Bug 363032. invalid arg assertion in nsFrameList.cpp. Patch by Alex Vincent <ajvincent@gmail.com>. r=enndeakin, sr=neil

This commit is contained in:
sayrer%gmail.com 2006-12-07 22:08:00 +00:00
parent dafa6a3461
commit 9c99d7cba4

View File

@ -157,12 +157,12 @@ nsDeckFrame::IndexChanged(nsPresContext* aPresContext)
Redraw(state);
// hide the currently showing box
nsIBox* currentBox = GetBoxAt(mIndex);
nsIBox* currentBox = (mIndex >= 0) ? GetBoxAt(mIndex) : nsnull;
if (currentBox) // only hide if it exists
HideBox(aPresContext, currentBox);
// show the new box
nsIBox* newBox = GetBoxAt(index);
nsIBox* newBox = (index >= 0) ? GetBoxAt(index) : nsnull;
if (newBox) // only show if it exists
ShowBox(aPresContext, newBox);
@ -195,7 +195,7 @@ nsDeckFrame::GetSelectedBox()
PRInt32 index = GetSelectedIndex();
// get the child at that index.
return GetBoxAt(index);
return (index >= 0) ? GetBoxAt(index) : nsnull;
}
NS_IMETHODIMP