File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ + (BOOL)isPath:(NSURL *)path aSubdirectoryOf:(NSURL *)directory {
144144
145145- (SandboxEntry *)recursivePathTest : (NSURL *)url {
146146 for (SandboxEntry *entry in storage) {
147- if ([SandboxBroker isPath: url aSubdirectoryOf: [NSURL fileURLWithPath: entry.path]]) {
147+ if (entry. path && [SandboxBroker isPath: url aSubdirectoryOf: [NSURL fileURLWithPath: entry.path]]) {
148148 entry.refCount += 1 ;
149149 return entry;
150150 }
@@ -162,11 +162,9 @@ - (SandboxEntry *)recursivePathTest:(NSURL *)url {
162162
163163 if (results && [results count ] > 0 ) {
164164 for (SandboxToken *token in results) {
165- if ([SandboxBroker isPath: url aSubdirectoryOf: [NSURL fileURLWithPath: token.path]]) {
165+ if (token. path && [SandboxBroker isPath: url aSubdirectoryOf: [NSURL fileURLWithPath: token.path]]) {
166166 SandboxEntry *entry = [[SandboxEntry alloc ] initWithToken: token];
167167
168- [storage addObject: entry];
169-
170168 BOOL isStale;
171169 NSError *err = nil ;
172170 NSURL *secureUrl = [NSURL URLByResolvingBookmarkData: token.bookmark options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil bookmarkDataIsStale: &isStale error: &err];
@@ -177,6 +175,8 @@ - (SandboxEntry *)recursivePathTest:(NSURL *)url {
177175
178176 entry.secureUrl = secureUrl;
179177
178+ [storage addObject: entry];
179+
180180 [secureUrl startAccessingSecurityScopedResource ];
181181
182182 return entry;
You can’t perform that action at this time.
0 commit comments