Repository: incubator-weex
Updated Branches:
  refs/heads/master e31e5eb45 -> 24214546f


* [iOS] fix crash about waterfall component, it can be crash when the return 
value of layoutAttributesForSupplementaryViewOfKind is nil
 so we add crash protector about the nil value


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/24214546
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/24214546
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/24214546

Branch: refs/heads/master
Commit: 24214546fade6baf430082c483bbe416abc0d9eb
Parents: e31e5eb
Author: acton393 <zhangxing610...@gmail.com>
Authored: Tue Dec 5 17:24:51 2017 +0800
Committer: acton393 <zhangxing610...@gmail.com>
Committed: Tue Dec 5 17:24:51 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/24214546/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m 
b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
index 8622ef8..b7ae652 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
@@ -281,6 +281,11 @@ NSString * const kMultiColumnLayoutCell = 
@"WXMultiColumnLayoutCell";
 {
     if ([elementKind isEqualToString:kCollectionSupplementaryViewKindHeader]) {
         UICollectionViewLayoutAttributes *attributes = 
self.layoutAttributes[kMultiColumnLayoutHeader][@(indexPath.section)];
+        if (!attributes) {
+            attributes = [UICollectionViewLayoutAttributes 
layoutAttributesForSupplementaryViewOfKind:elementKind withIndexPath:indexPath];
+            attributes.frame = CGRectZero;
+            attributes.hidden = YES;
+        }
         WXLogDebug(@"return header attributes:%@ for index path:%@", 
attributes, indexPath);
         
         return attributes;

Reply via email to