Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 498e5a9

Browse files
master-neviAdlai Holler
authored andcommitted
Assert when attempting to set a nil background / overlay layout element. (#2796)
1 parent eea5dda commit 498e5a9

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
6767

6868
- (void)setBackground:(id<ASLayoutElement>)background
6969
{
70+
ASDisplayNodeAssertNotNil(background, @"Background cannot be nil");
7071
[super setChild:background atIndex:kBackgroundChildIndex];
7172
}
7273

AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ - (instancetype)initWithChild:(id<ASLayoutElement>)child overlay:(id<ASLayoutEle
4343

4444
- (void)setOverlay:(id<ASLayoutElement>)overlay
4545
{
46+
ASDisplayNodeAssertNotNil(overlay, @"Overlay cannot be nil");
4647
[super setChild:overlay atIndex:kOverlayChildIndex];
4748
}
4849

0 commit comments

Comments
 (0)