From: Matti Tahvonen Date: Wed, 22 Oct 2008 06:35:36 +0000 (+0000) Subject: added null check (in case of empty ordered layout) X-Git-Tag: 6.7.0.beta1~3955 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=879d836f1b3e454a97ae3d6a3e06b86b04234cff;p=vaadin-framework.git added null check (in case of empty ordered layout) svn changeset:5692/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java index 5e14496553..fe5373fd1f 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java @@ -508,20 +508,21 @@ public class IOrderedLayout extends CellBasedLayout { */ private void updateContainerMargins() { ChildComponentContainer firstChildComponent = getFirstChildComponentContainer(); + if (firstChildComponent != null) { + firstChildComponent.setMarginLeft(0); + firstChildComponent.setMarginTop(0); - firstChildComponent.setMarginLeft(0); - firstChildComponent.setMarginTop(0); - - for (ChildComponentContainer childComponent : widgetToComponentContainer - .values()) { - if (childComponent == firstChildComponent) { - continue; - } + for (ChildComponentContainer childComponent : widgetToComponentContainer + .values()) { + if (childComponent == firstChildComponent) { + continue; + } - if (isHorizontal()) { - childComponent.setMarginLeft(activeSpacing.hSpacing); - } else { - childComponent.setMarginTop(activeSpacing.vSpacing); + if (isHorizontal()) { + childComponent.setMarginLeft(activeSpacing.hSpacing); + } else { + childComponent.setMarginTop(activeSpacing.vSpacing); + } } } }