diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m index 9d2c3a015..c21c3a9ac 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m +++ b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m @@ -194,10 +194,14 @@ #pragma mark - SyncClientProxyDelegate implementation -- (void)setResultForPath:(NSString*)path result:(NSString*)result +- (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 diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncSocketLineProcessor.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncSocketLineProcessor.m index e906154bb..79c5aa6e9 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncSocketLineProcessor.m +++ b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncSocketLineProcessor.m @@ -42,7 +42,7 @@ dispatch_async(dispatch_get_main_queue(), ^{ NSLog(@"Setting result %@ for path %@", result, path); - [self.delegate setResultForPath:path result:result]; + [self.delegate setResult:result forPath:path]; }); } else if([command isEqualToString:@"UPDATE_VIEW"]) { NSString *path = [split objectAtIndex:1]; diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h index f8c495a6c..05bbe091c 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h +++ b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h @@ -15,7 +15,7 @@ #import @protocol SyncClientDelegate -- (void)setResultForPath:(NSString *)path result:(NSString *)result; +- (void)setResult:(NSString *)result forPath:(NSString *)path; - (void)reFetchFileNameCacheForPath:(NSString *)path; - (void)registerPath:(NSString *)path; - (void)unregisterPath:(NSString *)path;