diff --git a/Shared/Images/FeedIconDownloader.swift b/Shared/Images/FeedIconDownloader.swift index 9f87a5f8e..630a13b94 100644 --- a/Shared/Images/FeedIconDownloader.swift +++ b/Shared/Images/FeedIconDownloader.swift @@ -37,18 +37,6 @@ public final class FeedIconDownloader { return cachedImage } - if let iconURL = feed.iconURL { - icon(forURL: iconURL) { (image) in - if let image = image { - self.postFeedIconDidBecomeAvailableNotification(feed) - self.cache[feed] = image - } - else { - checkHomePageURL() - } - } - } - func checkHomePageURL() { guard let homePageURL = feed.homePageURL else { return @@ -61,6 +49,22 @@ public final class FeedIconDownloader { } } + if let iconURL = feed.iconURL { + icon(forURL: iconURL) { (image) in + if let image = image { + self.postFeedIconDidBecomeAvailableNotification(feed) + self.cache[feed] = image + } + else { + checkHomePageURL() + } + } + } + else { + checkHomePageURL() + } + + return nil } }