You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/05/01 14:17:27 UTC

git commit: [flex-asjs] [refs/heads/develop] - Fix NPE when child of container is non UIBase

Repository: flex-asjs
Updated Branches:
  refs/heads/develop c22c0baab -> b85501827


Fix NPE when child of container is non UIBase


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b8550182
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b8550182
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b8550182

Branch: refs/heads/develop
Commit: b85501827fa4c27bda902ba362e8a2bc9d6990e9
Parents: c22c0ba
Author: piotrz <pi...@apache.org>
Authored: Mon May 1 16:17:22 2017 +0200
Committer: piotrz <pi...@apache.org>
Committed: Mon May 1 16:17:22 2017 +0200

----------------------------------------------------------------------
 .../apache/flex/html/beads/layouts/HorizontalFlexLayout.as    | 5 +++++
 .../org/apache/flex/html/beads/layouts/VerticalFlexLayout.as  | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b8550182/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalFlexLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalFlexLayout.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalFlexLayout.as
index 6fb927d..9c8f1ce 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalFlexLayout.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalFlexLayout.as
@@ -253,6 +253,11 @@ package org.apache.flex.html.beads.layouts
 
 				for(var i:int=0; i < n; i++) {
 					var child:UIBase = contentView.getElementAt(i) as UIBase;
+					if (!child)
+					{
+						continue;
+                    }
+					
 					if (grow >= 0) child.element.style["flex-grow"] = String(grow);
 					if (shrink >= 0) child.element.style["flex-shrink"] = String(shrink);
 					child.dispatchEvent(new Event("layoutNeeded"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b8550182/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
index bdc080d..6afc299 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
@@ -110,8 +110,6 @@ package org.apache.flex.html.beads.layouts
 				var n:Number = contentView.numElements;
 				if (n == 0) return false;
 
-				var spacing:String = "none";
-
 				var maxWidth:Number = 0;
 				var maxHeight:Number = 0;
 				var growCount:Number = 0;
@@ -249,6 +247,11 @@ package org.apache.flex.html.beads.layouts
 
 				for(var i:int=0; i < n; i++) {
 					var child:UIBase = contentView.getElementAt(i) as UIBase;
+					if (!child)
+					{
+						continue;
+                    }
+
 					if (grow >= 0) child.element.style["flex-grow"] = String(grow);
 					if (shrink >= 0) child.element.style["flex-shrink"] = String(shrink);
 					child.dispatchEvent(new Event("layoutNeeded"));