]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8019 fixed an NPE which came along with changing Sizable units from constants to...
authorJens Jansson <peppe@vaadin.com>
Thu, 22 Dec 2011 08:09:04 +0000 (10:09 +0200)
committerJens Jansson <peppe@vaadin.com>
Thu, 22 Dec 2011 10:26:15 +0000 (12:26 +0200)
src/com/vaadin/ui/AbstractComponent.java

index 7462aab3a58abe40fcfdca33e85394aedc075efa..4d81014e7fe8f954bfe13010397e49bb26086281 100644 (file)
@@ -1372,7 +1372,11 @@ public abstract class AbstractComponent implements Component, MethodEventSource
      */
     public void setWidth(String width) {
         Size size = parseStringSize(width);
-        setWidth(size.getSize(), size.getUnit());
+        if (size != null) {
+            setWidth(size.getSize(), size.getUnit());
+        } else {
+            setWidth(-1, Unit.PIXELS);
+        }
     }
 
     /*
@@ -1382,7 +1386,11 @@ public abstract class AbstractComponent implements Component, MethodEventSource
      */
     public void setHeight(String height) {
         Size size = parseStringSize(height);
-        setHeight(size.getSize(), size.getUnit());
+        if (size != null) {
+            setHeight(size.getSize(), size.getUnit());
+        } else {
+            setHeight(-1, Unit.PIXELS);
+        }
     }
 
     /*