Skip to content

Commit

Permalink
Added abort if no valid HTML is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Jun 21, 2011
1 parent bd284e6 commit ab09650
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/NSAttributedString+HTML.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttrib
// Make it a string
NSString *htmlString = [[NSString alloc] initWithData:data encoding:encoding];

if (!htmlString)
{
NSLog(@"No valid HTML passed to to initWithHTML");

[self release];
return nil;
}

// for performance we will return this mutable string
NSMutableAttributedString *tmpString = [[NSMutableAttributedString alloc] init];

Expand Down

0 comments on commit ab09650

Please sign in to comment.