You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/04/15 02:15:26 UTC

[incubator-weex] branch master updated: Fix potential crash of layout node.

This is an automated email from the ASF dual-hosted git repository.

jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new f04b977  Fix potential crash of layout node.
     new f2d8f1d  Merge pull request #2313 from wqyfavor/fix-scroller-layout
f04b977 is described below

commit f04b97751e62c5b329fef112be2ee7d62ad0fae2
Author: wqyfavor <qi...@taobao.com>
AuthorDate: Mon Apr 15 10:07:44 2019 +0800

    Fix potential crash of layout node.
---
 weex_core/Source/core/layout/layout.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/weex_core/Source/core/layout/layout.cpp b/weex_core/Source/core/layout/layout.cpp
index 86d671d..46c12e3 100644
--- a/weex_core/Source/core/layout/layout.cpp
+++ b/weex_core/Source/core/layout/layout.cpp
@@ -1105,6 +1105,9 @@ namespace WeexCore {
     void WXCoreLayoutNode::determineChildLayoutDirection(const WXCoreDirection direction) {
         for (Index i = 0; i < getChildCount(kBFC); ++i) {
             WXCoreLayoutNode *child = getChildAt(kBFC, i);
+            if (child == nullptr) {
+                continue;
+            }
             // determin direction
             if (child->mLayoutResult->mLayoutDirection == kDirectionInherit) {
                 if(child->mCssStyle->mDirection == kDirectionInherit) {