Handle possible nil favicon.urlString.

This commit is contained in:
Brent Simmons 2020-02-05 22:43:18 -08:00
parent 7f5d6babbd
commit 2cdcddeefe

View File

@ -54,14 +54,15 @@ struct FaviconURLFinder {
if ignoredMimeTypes.contains(type) { if ignoredMimeTypes.contains(type) {
return false return false
} }
} else { }
if let url = URL(string: favicon.urlString), ignoredExtensions.contains(url.pathExtension) { else {
if let urlString = favicon.urlString, let url = URL(string: urlString), ignoredExtensions.contains(url.pathExtension) {
return false return false
} }
} }
return true return true
}).map { $0.urlString } }).compactMap { $0.urlString }
completion(faviconURLs) completion(faviconURLs)
} }