2003/11/16 02:40:43
[org.ibex.core.git] / src / org / xwt / BoxTree.java
index 9f89ece..7d2d3d5 100644 (file)
@@ -412,7 +412,10 @@ public final class BoxTree extends Box {
             numchildren++;
 
             Box before = getChild(i);
-            if (before == null) rootChild.peerTree_rightmost().insertAfterMe(b);
+            if (before == null) {
+                if (rootChild == null) rootChild = b;
+                else rootChild.peerTree_rightmost().insertAfterMe(b);
+            }
             else before.insertBeforeMe(b);
             
             // need both of these in case child was already uncalc'ed