From 6ba0085215b89fcf3f65e96c78280f1e7cb74b4a Mon Sep 17 00:00:00 2001 From: Jens Jansson Date: Thu, 22 Dec 2011 10:09:04 +0200 Subject: [PATCH] #8019 fixed an NPE which came along with changing Sizable units from constants to enum --- src/com/vaadin/ui/AbstractComponent.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); + } } /* -- 2.39.5