You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/03 12:34:37 UTC

[GitHub] YorkShen closed pull request #1856: [weex_core] fix crash point just maybe

YorkShen closed pull request #1856: [weex_core] fix crash point just maybe 
URL: https://github.com/apache/incubator-weex/pull/1856
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/weex_core/Source/core/layout/layout.cpp b/weex_core/Source/core/layout/layout.cpp
index f079dc3c8b..83e77455fc 100644
--- a/weex_core/Source/core/layout/layout.cpp
+++ b/weex_core/Source/core/layout/layout.cpp
@@ -1120,13 +1120,16 @@ namespace WeexCore {
     
     WXCoreDirection WXCoreLayoutNode::getLayoutDirectionFromPathNode() {
         WXCoreLayoutNode *node = this;
-        if (node->getLayoutDirection() != kDirectionInherit) return node->getLayoutDirection();
-        if (node->getDirection() != kDirectionInherit) {
-            node->mLayoutResult->mLayoutDirection = node->getDirection();
-            return node->getLayoutDirection();
-        } else if (nullptr != node->mParent) {
-            node->mLayoutResult->mLayoutDirection = node->mParent->getLayoutDirectionFromPathNode();
-            return node->getLayoutDirection();
+        if (nullptr != node) {
+            if (node->getLayoutDirection() != kDirectionInherit)
+                return node->getLayoutDirection();
+            if (node->getDirection() != kDirectionInherit) {
+                node->mLayoutResult->mLayoutDirection = node->getDirection();
+                return node->getLayoutDirection();
+            } else if (nullptr != node->mParent) {
+                node->mLayoutResult->mLayoutDirection = node->mParent->getLayoutDirectionFromPathNode();
+                return node->getLayoutDirection();
+            }
         }
         return WEEXCORE_CSS_DEFAULT_DIRECTION;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services