Change to call completion when exiting early. Issue #1421

This commit is contained in:
Maurice Parker 2019-12-08 10:00:20 -07:00
parent a1675f0640
commit a3dc787fb0
1 changed files with 3 additions and 0 deletions

View File

@ -63,16 +63,19 @@ extension LocalAccountRefresher: DownloadSessionDelegate {
func downloadSession(_ downloadSession: DownloadSession, downloadDidCompleteForRepresentedObject representedObject: AnyObject, response: URLResponse?, data: Data, error: NSError?, completion: @escaping () -> Void) {
guard let feed = representedObject as? WebFeed, !data.isEmpty, !isSuspended else {
completion()
return
}
if let error = error {
print("Error downloading \(feed.url) - \(error)")
completion()
return
}
let dataHash = (data as NSData).rs_md5HashString()
if dataHash == feed.contentHash {
completion()
return
}