meismyles / SwiftWebVC

A drop-in inline browser for your Swift iOS app.
MIT License
330 stars 117 forks source link

Force-unwrapping URL leads to crash, if the url string is invalid. #29

Closed jason-breakaway closed 6 years ago

jason-breakaway commented 7 years ago
public convenience init(urlString: String) {
        var urlString = urlString
        if !urlString.hasPrefix("https://") && !urlString.hasPrefix("http://") {
            urlString = "https://"+urlString
        }
        self.init(pageURL: URL(string: urlString)!)
 }

when urlString is invalid, URL(string: urlString) is nil - that leads to crash.

meismyles commented 6 years ago

Can't recreate this crash so closing for now. An invalid URL just seems to cause the page to not load - but not crash.