daltoniam / Skeets

Fetch, cache, and display images via HTTP in Swift.
Apache License 2.0
191 stars 21 forks source link

Crashes When given Invalid URL #2

Closed mahmed8003 closed 9 years ago

mahmed8003 commented 9 years ago

Let suppose we have URL like this that have space in it, "http://www.clickreadshare.com/wp-content/uploads/bunny-on-a-bed-big .jpg"

Library return an error like this: fatal error: unexpectedly found nil while unwrapping an Optional value

return self.requestSerializer.createRequest(NSURL(string: urlVal)!,
            method: method, parameters: parameters)
    }

I think URL encode needs to be added.

daltoniam commented 9 years ago

Good catch, was a bug in SwiftHTTP as you noted above. I checked in a fix that should protect when invalid url is requested.