]> err.no Git - sope/blobdiff - sope-core/NGExtensions/NGBundleManager.m
NGLogEventFormatter.h was marked as project, not public - fixed
[sope] / sope-core / NGExtensions / NGBundleManager.m
index f4774237c944b6d810ba823a260460a5398f44ef..2a2489da0108ba34cbbad0cdb493c92b4dbba918 100644 (file)
@@ -22,6 +22,7 @@
 #include "NGBundleManager.h"
 #include "common.h"
 #include <NGExtensions/NSObject+Logs.h>
+#include <NGExtensions/NSNull+misc.h>
 #import <Foundation/NSFileManager.h>
 #import <EOControl/EOQualifier.h>
 #include <ctype.h>
@@ -595,12 +596,18 @@ static NSString *NGEnvVarPathSeparator = @":";
   bn     = [_name stringByAppendingPathExtension:_type];
   bundle = NSMapGet(self->nameToBundle, bn);
   
-  if (bundle == nil)
-    bundle = [self bundleWithPath:[self pathForBundleWithName:_name type:_type]];
-
+  if (![bundle isNotNull]) {
+    bundle = [self bundleWithPath:
+                    [self pathForBundleWithName:_name type:_type]];
+  }
+  
+  if (![bundle isNotNull]) /* NSNull is used to signal missing bundles */
+    return nil;
+  
   if (![[bundle bundleType] isEqualToString:_type])
-    bundle = nil;
-
+    return nil;
+  
+  /* bundle matches */
   return bundle;
 }
 - (NSBundle *)bundleWithName:(NSString *)_name {