From b53cbfcf2c4ea540adf3cf0bd6e1d10fa2233215 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 28 Jan 2020 16:24:35 -0700 Subject: [PATCH] Make sure completion handler is called when there are no active accounts. Issue #1727 --- Frameworks/Account/AccountManager.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Frameworks/Account/AccountManager.swift b/Frameworks/Account/AccountManager.swift index d932e36f8..1a273deb8 100644 --- a/Frameworks/Account/AccountManager.swift +++ b/Frameworks/Account/AccountManager.swift @@ -272,6 +272,11 @@ public final class AccountManager: UnreadCountProvider { var allFetchedArticles = Set
() let numberOfAccounts = activeAccounts.count var accountsReporting = 0 + + guard numberOfAccounts > 0 else { + completion(.success(allFetchedArticles)) + return + } for account in activeAccounts { account.fetchArticlesAsync(fetchType) { (articleSetResult) in