From 0fa30a9404e2d575372bfff737e5f13188347d02 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Sat, 10 Apr 2021 20:29:33 +0800 Subject: [PATCH] removes force unwrapping --- Account/Sources/Account/WebFeed.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Account/Sources/Account/WebFeed.swift b/Account/Sources/Account/WebFeed.swift index 80293e481..a705736e9 100644 --- a/Account/Sources/Account/WebFeed.swift +++ b/Account/Sources/Account/WebFeed.swift @@ -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