contentful-labs / Concorde

Download and decode progressive JPEGs on iOS.
MIT License
1.44k stars 152 forks source link

Fixed crash caused by decodedImage in CCBufferedImageView being nil. #14

Closed nmarisi closed 8 years ago

nmarisi commented 8 years ago

I've noticed that occasionally I get a crash when using CCBufferedImageView with progressive JPEGs. The crash is an EXC_BAD_ACCESS on the decodedImage variable in public func connection(connection: NSURLConnection, didReceiveData data: NSData).

This crash is quite easily reproducible if you place the CCBufferedImageView inside a tableview cell.

Adding a guard to make sure that decodedImage is not nil solves the issue.

neonichu commented 8 years ago

Thanks for the contribution :+1:

(test failures are unrelated)

nmarisi commented 8 years ago

You welcome, thanks for the library! Yes, I was wondering why travis CI failed before compiling any code...