mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-13 06:19:59 +00:00
Merge pull request #1486 from levi/update-asdk
[ASInsetLayoutSpec] Prevent from creating a computed layout when child is nil
This commit is contained in:
@@ -88,6 +88,12 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner)
|
||||
MAX(0, constrainedSize.max.height - insetsY),
|
||||
}
|
||||
};
|
||||
|
||||
if (self.child == nil) {
|
||||
ASDisplayNodeAssert(NO, @"Inset spec measured without a child. The spec will do nothing.");
|
||||
return [ASLayout layoutWithLayoutableObject:self size:CGSizeZero];
|
||||
}
|
||||
|
||||
ASLayout *sublayout = [self.child measureWithSizeRange:insetConstrainedSize];
|
||||
|
||||
const CGSize computedSize = ASSizeRangeClamp(constrainedSize, {
|
||||
|
||||
Reference in New Issue
Block a user