Skip to content

Commit

Permalink
Merge pull request #5 from emsquared/master
Browse files Browse the repository at this point in the history
Add sanity check for _response in ImageSizeCheckClient.m
  • Loading branch information
dburkart committed Jan 23, 2016
2 parents 4a9d249 + 18aef57 commit b7dc5e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Classes/Library/ImageSizeCheckClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)sender
{
if (_conn != sender) return;

/* If a user clicks a link that redirects to a data image, then
this value will not be NSHTTPURLResponse which results in a crash
when trying to make a call to -allHeaderFields */
if ([_response isKindOfClass:[NSHTTPURLResponse class]] == NO) {
return;
}

long long contentLength = 0;
NSString* contentType;
int statusCode = [_response statusCode];
Expand Down

0 comments on commit b7dc5e8

Please sign in to comment.