diff --git a/HTMLKit/HTMLInputStreamReaderErrors.h b/HTMLKit/HTMLInputStreamReaderErrors.h index 4bbc760..41a5e9a 100644 --- a/HTMLKit/HTMLInputStreamReaderErrors.h +++ b/HTMLKit/HTMLInputStreamReaderErrors.h @@ -21,8 +21,8 @@ typedef void (^ HTMLStreamReaderErrorCallback)(NSError *error); @interface HTMLInputStreamReaderErrors : NSObject -+ (void)reportParseError:(HTMLStreamReaderError)parseError - atLocation:(NSUInteger)location - andCallback:(HTMLStreamReaderErrorCallback)callback; ++ (void)emitParseError:(HTMLStreamReaderError)parseError + atLocation:(NSUInteger)location + andCallback:(HTMLStreamReaderErrorCallback)callback; @end diff --git a/HTMLKit/HTMLInputStreamReaderErrors.m b/HTMLKit/HTMLInputStreamReaderErrors.m index e6399c5..f900c45 100644 --- a/HTMLKit/HTMLInputStreamReaderErrors.m +++ b/HTMLKit/HTMLInputStreamReaderErrors.m @@ -26,7 +26,7 @@ static inline NSString * ReasonStringForError(HTMLStreamReaderError error) @implementation HTMLInputStreamReaderErrors -+ (void)reportParseError:(HTMLStreamReaderError)parseError atLocation:(NSUInteger)location andCallback:(HTMLStreamReaderErrorCallback)callback ++ (void)emitParseError:(HTMLStreamReaderError)parseError atLocation:(NSUInteger)location andCallback:(HTMLStreamReaderErrorCallback)callback { if (callback == nil) return; @@ -38,7 +38,7 @@ static inline NSString * ReasonStringForError(HTMLStreamReaderError error) NSError *error = [[NSError alloc] initWithDomain:HTMLStreamReaderErrorDomain code:parseError userInfo:userInfo]; - callback(error); + if (callback) callback(error); } @end