Skip to content

Commit

Permalink
Don't abort on invalid pubDates (fixes lilyball#11)
Browse files Browse the repository at this point in the history
If we have an invalid pubDate, just ignore it. This isn't worth aborting
the parsing over. In this event, just set pubDate to nil.
  • Loading branch information
lilyball committed Aug 7, 2010
1 parent ce49ccf commit ee87a3c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions FeedParser/FPItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ - (id)initWithBaseNamespaceURI:(NSString *)namespaceURI {
}

- (void)rss_pubDate:(NSString *)textValue attributes:(NSDictionary *)attributes parser:(NSXMLParser *)parser {
NSDate *date = [NSDate dateWithRFC822:textValue];
self.pubDate = date;
if (date == nil) [self abortParsing:parser withFormat:@"could not parse pubDate '%@'", textValue];
self.pubDate = [NSDate dateWithRFC822:textValue];
}

- (void)rss_link:(NSString *)textValue attributes:(NSDictionary *)attributes parser:(NSXMLParser *)parser {
Expand Down

0 comments on commit ee87a3c

Please sign in to comment.