diff --git a/Frameworks/Account/Feed.swift b/Frameworks/Account/Feed.swift index 43ed0cd25..aa9ebc677 100644 --- a/Frameworks/Account/Feed.swift +++ b/Frameworks/Account/Feed.swift @@ -16,7 +16,22 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { public let accountID: String public let url: String public let feedID: String - public var homePageURL: String? + + private var _homePageURL: String? + public var homePageURL: String? { + get { + return _homePageURL + } + set { + if let url = newValue { + _homePageURL = url.rs_normalizedURL() + } + else { + _homePageURL = nil + } + } + } + public var iconURL: String? public var faviconURL: String? public var name: String? @@ -86,9 +101,7 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { let feedID = dictionary[Key.feedID] as? String ?? url self.init(accountID: accountID, url: url, feedID: feedID) - if let homePageURL = dictionary[Key.homePageURL] as? String { - self.homePageURL = homePageURL.rs_normalizedURL() - } + self.homePageURL = dictionary[Key.homePageURL] as? String self.iconURL = dictionary[Key.iconURL] as? String self.faviconURL = dictionary[Key.faviconURL] as? String self.name = dictionary[Key.name] as? String