2003/11/29 03:06:09
[org.ibex.core.git] / src / org / xwt / Surface.java
index ac2a837..97041f1 100644 (file)
@@ -2,6 +2,7 @@
 package org.xwt;
 
 import org.bouncycastle.util.encoders.Base64;
+import org.xwt.js.*;
 import org.xwt.util.*;
 import java.io.*;
 import java.util.*;
@@ -298,7 +299,11 @@ public abstract class Surface extends PixelBuffer {
         this.root = root;
         Surface old = fromBox(root);
         if (old != null) old.dispose(false);
-        else root.put("thisbox", null);
+        else try {
+            root.put("thisbox", null);
+        } catch (JSExn e) {
+            throw new Error("this should never happen");
+        }
 
         // make sure the root is properly sized
         do { abort = false; root.reflow(root.width, root.height); } while(abort);