aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMNSFileManager+Path.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-05-27 20:00:36 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-05-27 20:00:36 +0000
commita470905a1dffcc61761dc49be13c2d1c8761d0d1 (patch)
tree205b275ae5a16debc9ac09305d290dd1e67bb4a0 /Foundation/GTMNSFileManager+Path.m
parentdca2c72842b9e34a094bef74a04970cfa39bce14 (diff)
[Author: dmaclach]
Fix up issues in GTMNSFileManager+Path. R=thomasvl DELTA=9 (2 added, 2 deleted, 5 changed)
Diffstat (limited to 'Foundation/GTMNSFileManager+Path.m')
-rw-r--r--Foundation/GTMNSFileManager+Path.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Foundation/GTMNSFileManager+Path.m b/Foundation/GTMNSFileManager+Path.m
index bd0aef9..6ec298b 100644
--- a/Foundation/GTMNSFileManager+Path.m
+++ b/Foundation/GTMNSFileManager+Path.m
@@ -68,21 +68,20 @@
- (NSArray *)gtm_filePathsWithExtensions:(NSArray *)extensions
inDirectory:(NSString *)directoryPath {
- if (directoryPath == nil)
+ if (!directoryPath) {
return nil;
+ }
// |basenames| will contain only the matching file names, not their full paths.
- NSError *error = nil;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
NSArray *basenames = [self contentsOfDirectoryAtPath:directoryPath
- error:&error];
+ error:nil];
#else
NSArray *basenames = [self directoryContentsAtPath:directoryPath];
#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
// Check if dir doesn't exist or couldn't be opened.
- if (basenames == nil) {
- _GTMDevLog(@"Error: %@", error);
+ if (!basenames) {
return nil;
}
@@ -101,8 +100,9 @@
}
// Check if caller wants all files, regardless of extension.
- if (extensions == nil || [extensions count] == 0)
+ if ([extensions count] == 0) {
return paths;
+ }
return [paths pathsMatchingExtensions:extensions];
}