From ef6a79489ade1f315bea4403c92fcfe3f2a3a145 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 2 Apr 2020 12:25:23 -0500 Subject: [PATCH] Add missing completion block calls. --- .../Account/LocalAccount/LocalAccountRefresher.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift b/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift index 7d13f058b..1823e0bb1 100644 --- a/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift +++ b/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift @@ -116,18 +116,26 @@ extension LocalAccountRefresher: DownloadSessionDelegate { } if data.isDefinitelyNotFeed() { + feedCompletionBlock?(feed) return false } if data.count > 4096 { let parserData = ParserData(url: feed.url, data: data) - return FeedParser.mightBeAbleToParseBasedOnPartialData(parserData) + if FeedParser.mightBeAbleToParseBasedOnPartialData(parserData) { + return true + } else { + feedCompletionBlock?(feed) + return false + } } return true } func downloadSession(_ downloadSession: DownloadSession, didReceiveUnexpectedResponse response: URLResponse, representedObject: AnyObject) { + let feed = representedObject as! WebFeed + feedCompletionBlock?(feed) } func downloadSession(_ downloadSession: DownloadSession, didReceiveNotModifiedResponse: URLResponse, representedObject: AnyObject) {