From a470905a1dffcc61761dc49be13c2d1c8761d0d1 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 27 May 2010 20:00:36 +0000 Subject: [Author: dmaclach] Fix up issues in GTMNSFileManager+Path. R=thomasvl DELTA=9 (2 added, 2 deleted, 5 changed) --- Foundation/GTMNSFileManager+Path.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Foundation/GTMNSFileManager+Path.m') 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]; } -- cgit v1.2.3