aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/AbstractComponent.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/ui/AbstractComponent.java')
-rw-r--r--src/com/vaadin/ui/AbstractComponent.java12
1 files 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);
+ }
}
/*