From 1201d1c9194b8d906b5b5abd1ed00e0b179d991d Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 17 Nov 2004 22:16:19 +0000 Subject: [PATCH] fixed an edge case with NGBundleManager git-svn-id: http://svn.opengroupware.org/SOPE/trunk@390 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-core/NGExtensions/ChangeLog | 5 +++++ sope-core/NGExtensions/NGBundleManager.m | 11 ++++++++--- sope-core/NGExtensions/NGExtensions/NSNull+misc.h | 5 ++--- sope-core/NGExtensions/Version | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 6679ca3e..da9f19cc 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,8 @@ +2004-11-17 Helge Hess + + * NGBundleManager.m: fixed a bug in the bundle type check when the + cached bundle is NSNull (v4.5.133) + 2004-11-17 Marcus Mueller * NGLogging: updated (v4.5.132) diff --git a/sope-core/NGExtensions/NGBundleManager.m b/sope-core/NGExtensions/NGBundleManager.m index 001fc60d..8edd9d4d 100644 --- a/sope-core/NGExtensions/NGBundleManager.m +++ b/sope-core/NGExtensions/NGBundleManager.m @@ -22,6 +22,7 @@ #include "NGBundleManager.h" #include "common.h" #include +#include #import #import #include @@ -595,14 +596,18 @@ static NSString *NGEnvVarPathSeparator = @":"; bn = [_name stringByAppendingPathExtension:_type]; bundle = NSMapGet(self->nameToBundle, bn); - if (bundle == nil) { + if (![bundle isNotNull]) { bundle = [self bundleWithPath: [self pathForBundleWithName:_name type:_type]]; } - if (bundle != nil && ![[bundle bundleType] isEqualToString:_type]) - bundle = nil; + if (![bundle isNotNull]) /* NSNull is used to signal missing bundles */ + return nil; + + if (![[bundle bundleType] isEqualToString:_type]) + return nil; + /* bundle matches */ return bundle; } - (NSBundle *)bundleWithName:(NSString *)_name { diff --git a/sope-core/NGExtensions/NGExtensions/NSNull+misc.h b/sope-core/NGExtensions/NGExtensions/NSNull+misc.h index eb6b3eed..414be0f6 100644 --- a/sope-core/NGExtensions/NGExtensions/NSNull+misc.h +++ b/sope-core/NGExtensions/NGExtensions/NSNull+misc.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #ifndef __NSNull_misc_H__ #define __NSNull_misc_H__ diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 52895010..a03e8d98 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=132 +SUBMINOR_VERSION:=133 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 -- 2.39.5