diff --git a/ChangeLog b/ChangeLog index 85d34b253..deffdb041 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-07-04 Wolfgang Sourdeau + * Main/SOGo.m ([SOGo -lookupUser:_keyinContext:]): check if the + user exists before creating the SOGoUserFolder instance. If not, + returns nil. + * UI/MailerUI/UIxMailSourceView.[hm]: new class module designed to return the message source code in plain text. diff --git a/Main/SOGo.m b/Main/SOGo.m index efe2accf1..0ee12f43c 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -43,6 +43,7 @@ #import #import +#import #import #import "SOGoProductLoader.h" @@ -241,9 +242,20 @@ static BOOL debugObjectAllocation = NO; return YES; } -- (id)lookupUser:(NSString *)_key inContext:(id)_ctx { - return [$(@"SOGoUserFolder") objectWithName:_key - inContainer: self]; +- (id) lookupUser: (NSString *) _key + inContext: (id)_ctx +{ + SOGoUser *user; + id userFolder; + + user = [SOGoUser userWithLogin: _key roles: nil]; + if (user) + userFolder = [$(@"SOGoUserFolder") objectWithName: _key + inContainer: self]; + else + userFolder = nil; + + return userFolder; } - (void) _setupLocaleInContext: (WOContext *) _ctx @@ -289,7 +301,7 @@ static BOOL debugObjectAllocation = NO; if ([self isUserName:_key inContext:_ctx]) return [self lookupUser:_key inContext:_ctx]; - + return nil; }