Change to call completion when exiting early. Issue #1421
This commit is contained in:
parent
a1675f0640
commit
a3dc787fb0
|
@ -63,16 +63,19 @@ extension LocalAccountRefresher: DownloadSessionDelegate {
|
||||||
|
|
||||||
func downloadSession(_ downloadSession: DownloadSession, downloadDidCompleteForRepresentedObject representedObject: AnyObject, response: URLResponse?, data: Data, error: NSError?, completion: @escaping () -> Void) {
|
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 {
|
guard let feed = representedObject as? WebFeed, !data.isEmpty, !isSuspended else {
|
||||||
|
completion()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let error = error {
|
if let error = error {
|
||||||
print("Error downloading \(feed.url) - \(error)")
|
print("Error downloading \(feed.url) - \(error)")
|
||||||
|
completion()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let dataHash = (data as NSData).rs_md5HashString()
|
let dataHash = (data as NSData).rs_md5HashString()
|
||||||
if dataHash == feed.contentHash {
|
if dataHash == feed.contentHash {
|
||||||
|
completion()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue