Merge branch 'mac-release'

This commit is contained in:
Brent Simmons 2019-09-03 22:59:29 -07:00
commit 2ec55e6587
1 changed files with 5 additions and 1 deletions

View File

@ -52,10 +52,14 @@ class FetchRequestOperation {
var fetchersReturned = 0 var fetchersReturned = 0
var fetchedArticles = Set<Article>() var fetchedArticles = Set<Article>()
for articleFetcher in articleFetchers { for articleFetcher in articleFetchers {
var didCallCompletion = false
articleFetcher.fetchArticlesAsync { (articles) in articleFetcher.fetchArticlesAsync { (articles) in
precondition(Thread.isMainThread) precondition(Thread.isMainThread)
if self.isCanceled { if self.isCanceled {
completion(self) if !didCallCompletion {
didCallCompletion = true
completion(self)
}
return return
} }
fetchedArticles.formUnion(articles) fetchedArticles.formUnion(articles)