зеркало из https://github.com/nextcloud/desktop.git
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:
Коммит
c1f9861265
|
@ -194,10 +194,14 @@
|
||||||
|
|
||||||
#pragma mark - SyncClientProxyDelegate implementation
|
#pragma mark - SyncClientProxyDelegate implementation
|
||||||
|
|
||||||
- (void)setResultForPath:(NSString*)path result:(NSString*)result
|
- (void)setResult:(NSString *)result forPath:(NSString*)path
|
||||||
{
|
{
|
||||||
NSString *normalizedPath = [path decomposedStringWithCanonicalMapping];
|
NSString *const normalizedPath = path.decomposedStringWithCanonicalMapping;
|
||||||
[[FIFinderSyncController defaultController] setBadgeIdentifier:result forURL:[NSURL fileURLWithPath:normalizedPath]];
|
NSURL *const urlForPath = [NSURL fileURLWithPath:normalizedPath];
|
||||||
|
if (urlForPath == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
[FIFinderSyncController.defaultController setBadgeIdentifier:result forURL:urlForPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reFetchFileNameCacheForPath:(NSString*)path
|
- (void)reFetchFileNameCacheForPath:(NSString*)path
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSLog(@"Setting result %@ for path %@", result, path);
|
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"]) {
|
} else if([command isEqualToString:@"UPDATE_VIEW"]) {
|
||||||
NSString *path = [split objectAtIndex:1];
|
NSString *path = [split objectAtIndex:1];
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@protocol SyncClientDelegate <NSObject>
|
@protocol SyncClientDelegate <NSObject>
|
||||||
- (void)setResultForPath:(NSString *)path result:(NSString *)result;
|
- (void)setResult:(NSString *)result forPath:(NSString *)path;
|
||||||
- (void)reFetchFileNameCacheForPath:(NSString *)path;
|
- (void)reFetchFileNameCacheForPath:(NSString *)path;
|
||||||
- (void)registerPath:(NSString *)path;
|
- (void)registerPath:(NSString *)path;
|
||||||
- (void)unregisterPath:(NSString *)path;
|
- (void)unregisterPath:(NSString *)path;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче