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

Commit 3d6ba66

Browse files
committed
Merge pull request #831 from facebook/ASCIICrash
Fix crash in ASCII art creator for one-element children arrays.
2 parents e8d2386 + 6d8bad1 commit 3d6ba66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AsyncDisplayKit/Layout/ASLayoutSpec.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ + (NSString *)asciiArtStringForChildren:(NSArray *)children parentName:(NSString
150150

151151
- (NSString *)asciiArtString
152152
{
153-
return [ASLayoutSpec asciiArtStringForChildren:@[self.child] parentName:[self asciiArtName]];
153+
NSArray *children = self.child ? @[self.child] : self.children;
154+
return [ASLayoutSpec asciiArtStringForChildren:children parentName:[self asciiArtName]];
154155
}
155156

156157
- (NSString *)asciiArtName

0 commit comments

Comments
 (0)