Do not crash is NSSearchPathForDirectoriesInDomain return nil

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9671 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2001-04-23 11:27:11 +00:00
parent 6abec05072
commit 9e8bb6adda

View file

@ -517,7 +517,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if (env) if (env)
{ {
NSArray *paths; NSArray *paths;
NSMutableString *system; NSMutableString *system = nil;
NSString *str; NSString *str;
if ((str = [env objectForKey: @"GNUSTEP_TARGET_DIR"]) != nil) if ((str = [env objectForKey: @"GNUSTEP_TARGET_DIR"]) != nil)
@ -541,7 +541,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
paths = NSSearchPathForDirectoriesInDomains(GSLibrariesDirectory, paths = NSSearchPathForDirectoriesInDomains(GSLibrariesDirectory,
NSSystemDomainMask, YES); NSSystemDomainMask, YES);
if ((paths != nil) && ([paths count] > 0)) if ((paths != nil) && ([paths count] > 0))
system = RETAIN([paths objectAtIndex: 0]); system = RETAIN([paths objectAtIndex: 0]);
_executable_path = nil; _executable_path = nil;
#ifdef PROCFS_EXE_LINK #ifdef PROCFS_EXE_LINK