Skip to content


Subversion checkout URL

You can clone with
Download ZIP


crash when attempting to cache an invalid image #308

funkadelic opened this Issue · 1 comment

2 participants


AFNetworking crashes when it attempts to cache an invalid image. eg:

the above request returns an HTTP 200 response, but it does not have a body in the HTTP response.

this results in a crash with the following in the console

2012-04-18 18:16:58.445 Raptr[41308:15203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AFImageCache setObject:forKey:cost:]: attempt to insert nil value (key:'
*** First throw call stack:
(0x2160022 0x25f7cd6 0x20d818d 0x20d7fc3 0x132753 0x1321dc 0x127df9 0x1f23330 0x1f25509 0x2097803 0x2096d84 0x2096c9b 0x28097d8 0x280988a 0xcf4626 0x2e1d 0x2d95)
terminate called throwing an exception(lldb) 

Thanks for pointing this out. I just pushed a fix for this in 9adb586. Cheers!

@mattt mattt closed this
@dedmons dedmons referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@egrim egrim referenced this issue from a commit in egrim/AFNetworking
@mattt mattt [Issue #308] Fixing crash caused by attempting to cache invalid or ni…
…l image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.