Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

crash when attempting to cache an invalid image #308

Closed
funkadelic opened this Issue · 1 comment

2 participants

@funkadelic

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

http://b0.raptrcdn.com/img/avatars/small/f04b4c007cf01c77d9ec95b2ad477e97.127883f38b8bc0ce9d50d3ac9d0bc41d

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: http://b0.raptrcdn.com/img/avatars/small/f04b4c007cf01c77d9ec95b2ad477e97.127883f38b8bc0ce9d50d3ac9d0bc41d)'
*** 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) 
@mattt
Owner

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
4a37b2a
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.