diff --git a/layout/xul/base/src/nsSprocketLayout.cpp b/layout/xul/base/src/nsSprocketLayout.cpp index b6803f994d4e..6d78f8fa4bd0 100644 --- a/layout/xul/base/src/nsSprocketLayout.cpp +++ b/layout/xul/base/src/nsSprocketLayout.cpp @@ -782,8 +782,10 @@ nsSprocketLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, nsBox while(child) { - while (currentBox && currentBox->bogus) + while (currentBox && currentBox->bogus) { + last = currentBox; currentBox = currentBox->next; + } ++childCount; nsSize pref(0,0); nsSize min(0,0);