[_loadAvailableColorLists] check if a directory exists before

looking for a colour list in it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15911 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2003-02-09 00:36:53 +00:00
parent 7925725bb9
commit 5b3f1e1bbf

View file

@ -90,16 +90,25 @@ static NSLock *_gnustep_color_list_lock = nil;
while ((dir = (NSString *)[e nextObject]))
{
BOOL flag;
dir = [dir stringByAppendingPathComponent: @"Colors"];
if (![fm fileExistsAtPath: dir isDirectory: &flag] || !flag)
{
// Only process existing directories
continue;
}
de = [fm enumeratorAtPath: dir];
while ((file = [de nextObject]))
{
if ([[file pathExtension] isEqualToString: @"clr"])
{
file = [file stringByDeletingPathExtension];
newList = AUTORELEASE ([[NSColorList alloc] initWithName: file
fromFile: dir]);
newList = [[NSColorList alloc] initWithName: file
fromFile: dir];
[_gnustep_available_color_lists addObject: newList];
RELEASE(newList);
}
}
}