removes force unwrapping

This commit is contained in:
Stuart Breckenridge 2021-04-10 20:29:33 +08:00
parent 0a433b8573
commit 0fa30a9404
No known key found for this signature in database
GPG Key ID: ED2F112EEA9EF8A5
1 changed files with 7 additions and 2 deletions

View File

@ -228,8 +228,13 @@ public final class WebFeed: Feed, Renamable, Hashable {
// MARK: - Feed Provider
public var isFeedProvider: Bool {
get {
if FeedProviderManager.shared.best(for: URLComponents(url: URL(string: url)!, resolvingAgainstBaseURL: false)!) == nil {
get {
guard let webfeedURL = URL(string: url),
let components = URLComponents(url: webfeedURL, resolvingAgainstBaseURL: false) else {
return false
}
if FeedProviderManager.shared.best(for: components) == nil {
return false
}
return true