@@ -301,23 +301,26 @@ void CollectAllAUPresetFilesInDir(CFURLRef inDirURL, CFTreeRef inParentTree, Aud
301
301
}
302
302
303
303
// first, we query the directory's contents
304
- NSArray <NSURL *>* dirContents = [NSFileManager .defaultManager contentsOfDirectoryAtURL: (__bridge NSURL *)inDirURL includingPropertiesForKeys: resourceKeys options: NSDirectoryEnumerationSkipsHiddenFiles error: nil ];
304
+ NSArray <NSURL *>* const dirContents = [NSFileManager .defaultManager contentsOfDirectoryAtURL: (__bridge NSURL *)inDirURL includingPropertiesForKeys: resourceKeys options: NSDirectoryEnumerationSkipsHiddenFiles error: nil ];
305
305
if (dirContents == nil )
306
306
{
307
307
goto checkEmptyTree;
308
308
}
309
309
310
310
// this is the main loop through each directory item using the array of contents
311
- for (NSURL * url in dirContents)
311
+ for (NSURL * const url in dirContents)
312
312
{
313
313
CFURLRef const urlCF = (__bridge CFURLRef )url;
314
314
NSNumber * isDirectory = nil ;
315
315
BOOL const success = [url getResourceValue: &isDirectory forKey: NSURLIsDirectoryKey error: nil ];
316
316
// if the current item itself is a directory, then we recursively call this function on that sub-directory
317
- if (success && ( isDirectory != nil ) && isDirectory. boolValue )
317
+ if (success && [ isDirectory boolValue ] )
318
318
{
319
319
CFTreeRef const newSubTree = AddFileItemToTree (urlCF, inParentTree);
320
- CollectAllAUPresetFilesInDir (urlCF, newSubTree, inAUComponent);
320
+ if (newSubTree != NULL )
321
+ {
322
+ CollectAllAUPresetFilesInDir (urlCF, newSubTree, inAUComponent);
323
+ }
321
324
}
322
325
// otherwise it's a file, so we add it (if it is an AU preset file)
323
326
else if (CFURLIsAUPreset (urlCF))
0 commit comments