evermeer / EVURLCache

a NSURLCache subclass for handling all web requests that use NSURLRequest
Other
297 stars 49 forks source link

Crash in - (void)storeCachedResponse:(NSCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request #56

Closed schmidt9 closed 6 years ago

schmidt9 commented 6 years ago

Error message:

-[NSURLResponse statusCode]: unrecognized selector sent

Suggested fix:

if(httpResponse != nil && [httpResponse respondsToSelector:@selector(statusCode:)] && httpResponse.statusCode >=
            400)
    {
        NSLog(@"CACHE Do not cache error %li page for: %@", (long)httpResponse.statusCode, request.URL);
        return;
    }
evermeer commented 6 years ago

I made this change in the Objective C branch

schmidt9 commented 6 years ago

I don't see any changes

evermeer commented 6 years ago

hmm... I forgot to sync. It should be updated now.