From 879d836f1b3e454a97ae3d6a3e06b86b04234cff Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 22 Oct 2008 06:35:36 +0000 Subject: [PATCH] added null check (in case of empty ordered layout) svn changeset:5692/svn branch:trunk --- .../gwt/client/ui/IOrderedLayout.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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); + } } } } -- 2.39.5