From ffa0e55025a46655b6c7fde0325237a959ba93fe Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 29 Oct 2024 17:31:59 +0800 Subject: [PATCH] Do not set badge identifier for a given path URL if the URL is nil Signed-off-by: Claudio Cambra --- .../NextcloudIntegration/FinderSyncExt/FinderSync.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m index 822a2b6393846..c21c3a9ac3f5b 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m +++ b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m @@ -196,8 +196,12 @@ - (void)subMenuActionClicked:(id)sender { - (void)setResult:(NSString *)result forPath:(NSString*)path { - NSString *normalizedPath = [path decomposedStringWithCanonicalMapping]; - [[FIFinderSyncController defaultController] setBadgeIdentifier:result forURL:[NSURL fileURLWithPath:normalizedPath]]; + NSString *const normalizedPath = path.decomposedStringWithCanonicalMapping; + NSURL *const urlForPath = [NSURL fileURLWithPath:normalizedPath]; + if (urlForPath == nil) { + return; + } + [FIFinderSyncController.defaultController setBadgeIdentifier:result forURL:urlForPath]; } - (void)reFetchFileNameCacheForPath:(NSString*)path