Fix crash in ASCII art creator for one-element children arrays

This commit is contained in:
Scott Goodson
2015-11-08 19:04:16 -08:00
parent e8d238610f
commit 6d8bad13c0

View File

@@ -150,7 +150,8 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey";
- (NSString *)asciiArtString
{
return [ASLayoutSpec asciiArtStringForChildren:@[self.child] parentName:[self asciiArtName]];
NSArray *children = self.child ? @[self.child] : self.children;
return [ASLayoutSpec asciiArtStringForChildren:children parentName:[self asciiArtName]];
}
- (NSString *)asciiArtName