From 0e2bfeb671ce4634da57c0b4723fdd0de3c7b126 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 5 Jul 2022 23:45:46 -0700 Subject: [PATCH] [Path Config] Properly report broken bookmarks Broken bookmarks weren't reporting as isStale, but rather, were failing to resolve at all, and without this change, they were impossible to detect in a migrated configuration. Signed-off-by: Christopher Snowhill --- Preferences/Preferences/SandboxPathBehaviorController.m | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Preferences/Preferences/SandboxPathBehaviorController.m b/Preferences/Preferences/SandboxPathBehaviorController.m index ea279daef..0a9ca69c2 100644 --- a/Preferences/Preferences/SandboxPathBehaviorController.m +++ b/Preferences/Preferences/SandboxPathBehaviorController.m @@ -44,11 +44,7 @@ BOOL isStale = YES; NSError *err = nil; NSURL *bookmarkUrl = [NSURL URLByResolvingBookmarkData:token.bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&err]; - if(!bookmarkUrl) { - ALog(@"Stale bookmark for path: %@, with error: %@", token.path, [err localizedDescription]); - continue; - } - [self addObject:@{ @"path": token.path, @"valid": (isStale ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder) }]; + [self addObject:@{ @"path": token.path, @"valid": ((!bookmarkUrl || isStale) ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder), @"token": token }]; } } }