Handle possible nil favicon.urlString.

This commit is contained in:
Brent Simmons 2020-02-05 22:43:18 -08:00
parent 7f5d6babbd
commit 2cdcddeefe
1 changed files with 4 additions and 3 deletions

View File

@ -54,14 +54,15 @@ struct FaviconURLFinder {
if ignoredMimeTypes.contains(type) {
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 true
}).map { $0.urlString }
}).compactMap { $0.urlString }
completion(faviconURLs)
}