Skip to content

Commit

Permalink
fixed the empty string case
Browse files Browse the repository at this point in the history
  • Loading branch information
joshaber committed May 28, 2011
1 parent ff5d566 commit f6f2604
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UIKit/Classes/UIStringDrawing.m
Expand Up @@ -46,6 +46,14 @@ static CFArrayRef CreateCTLinesForAttributedString(NSAttributedString *attribute
CFMutableArrayRef lines = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
CGSize drawSize = CGSizeZero;

if(attributedString.length < 1) {
if (renderSize) {
*renderSize = drawSize;
}

return lines;
}

NSDictionary *attributes = [attributedString attributesAtIndex:0 effectiveRange:NULL];
CTFontRef font = (CTFontRef) [attributes objectForKey:(id) kCTFontAttributeName];

Expand Down

0 comments on commit f6f2604

Please sign in to comment.