+2007-05-07 Helge Hess <helge.hess@opengroupware.org>
+
+ * WOSession.m: do not attempt to process 'nil' keys when working on
+ extra variables (lead to NSDictionary exceptions) (v4.7.8)
+
2007-05-08 Helge Hess <helge.hess@opengroupware.org>
* WOApplication.m: properly call +_setupSNS method
rng = [login rangeOfString:@"\\"];
if (rng.length > 0) {
- [self debugWithFormat:@"splitting of domain in login: '%@'", login];
+ [self debugWithFormat:@"splitting off domain in login: '%@'", login];
login = [login substringFromIndex:(rng.location + rng.length)];
}
return [NSArray arrayWithObjects:login, pwd, nil];
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2007 SKYRIX Software AG
+ Copyright (C) 2007 Helge Hess
This file is part of SOPE.
/* session variables */
- (void)setObject:(id)_obj forKey:(NSString *)_key {
+ if (_key == nil) {
+ [self warnWithFormat:@"%s: got no key for extra variable.",
+ __PRETTY_FUNCTION__];
+ return;
+ }
+
if (self->wosVariables == nil)
self->wosVariables = [[NSMutableDictionary alloc] initWithCapacity:16];
- if (_obj)
+ if (_obj != nil)
[self->wosVariables setObject:_obj forKey:_key];
else
[self->wosVariables removeObjectForKey:_key];
}
+
- (id)objectForKey:(NSString *)_key {
- return [self->wosVariables objectForKey:_key];
+ return _key != nil ? [self->wosVariables objectForKey:_key] : nil;
}
- (void)removeObjectForKey:(NSString *)_key {
+ if (_key == nil) {
+ [self warnWithFormat:@"%s: got no key of extra variable to be removed.",
+ __PRETTY_FUNCTION__];
+ return;
+ }
+
[self->wosVariables removeObjectForKey:_key];
}