]> source.dussan.org Git - vaadin-framework.git/commitdiff
added null check
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 16 Aug 2007 09:37:58 +0000 (09:37 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 16 Aug 2007 09:37:58 +0000 (09:37 +0000)
svn changeset:2027/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java

index 830d92deda7b15e1b6c5bad3759c85866bc2a457..d21bb60a297bbe2008d2e2c9a29f299ec28ce603 100644 (file)
@@ -392,9 +392,12 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
 
        protected void onDetach() {
                super.onDetach();
-               if(scrollPositionElement != null)
-                       DOM.removeChild(DOM.getParent(scrollPositionElement),
-                                       scrollPositionElement);
+               //ensure that scrollPosElement will be detached
+               if(scrollPositionElement != null) {
+                       Element parent = DOM.getParent(scrollPositionElement);
+                       if(parent != null)
+                               DOM.removeChild(parent, scrollPositionElement);
+               }
        }
 
        /**