From: Jens Jansson Date: Thu, 22 Dec 2011 08:09:04 +0000 (+0200) Subject: #8019 fixed an NPE which came along with changing Sizable units from constants to... X-Git-Tag: 7.0.0.alpha2~545^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cc4c6b28f4d07d70913abe44149117f8dc343601;p=vaadin-framework.git #8019 fixed an NPE which came along with changing Sizable units from constants to enum --- diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index 7462aab3a5..4d81014e7f 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -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); + } } /*