mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-18 03:41:50 +03:00
Merge pull request #7432 from nextcloud/bugfix/findersyncext-crash-pt3000
Fix crash when setting badge for a path that results in a nil URL (macOS FinderSyncExt)
This commit is contained in:
commit
c1f9861265
3 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol SyncClientDelegate <NSObject>
|
||||
- (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;
|
||||
|
|
Loading…
Reference in a new issue