From e83694ceb038867250e5f42ac141cec74e4c30b5 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 29 Apr 2020 19:17:02 -0500 Subject: [PATCH] Prevent deletes if there are no records to delete --- .../Account/CloudKit/CloudKitArticlesZoneDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Frameworks/Account/CloudKit/CloudKitArticlesZoneDelegate.swift b/Frameworks/Account/CloudKit/CloudKitArticlesZoneDelegate.swift index bb9330764..472f4480d 100644 --- a/Frameworks/Account/CloudKit/CloudKitArticlesZoneDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitArticlesZoneDelegate.swift @@ -67,6 +67,11 @@ private extension CloudKitArticlesZoneDelegate { let receivedArticleIDs = Set(receivedRecordIDs.map({ stripPrefix($0.externalID) })) let deletableArticleIDs = receivedArticleIDs.subtracting(pendingStarredStatusArticleIDs) + guard !deletableArticleIDs.isEmpty else { + completion() + return + } + database.deleteSelectedForProcessing(Array(deletableArticleIDs)) { _ in self.account?.delete(articleIDs: deletableArticleIDs) { _ in completion()