From: helge Date: Sat, 30 Sep 2006 13:54:01 +0000 (+0000) Subject: improved error handling X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d836196a0c7f391345aed57378f1a79bb20f7c8a;p=sope improved error handling git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1365 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/EOControl/ChangeLog b/sope-core/EOControl/ChangeLog index 168583ed..8d8da17d 100644 --- a/sope-core/EOControl/ChangeLog +++ b/sope-core/EOControl/ChangeLog @@ -1,3 +1,8 @@ +2006-09-30 Helge Hess + + * EOKeyGlobalID.m: print a warning if a key-gid is created with a nil + value, improved -description (v4.5.68) + 2006-08-18 Helge Hess * EOKeyValueCoding.m: -valueForKey: now returns mutable arrays when diff --git a/sope-core/EOControl/EOKeyGlobalID.m b/sope-core/EOControl/EOKeyGlobalID.m index c11e3db6..43966e8c 100644 --- a/sope-core/EOControl/EOKeyGlobalID.m +++ b/sope-core/EOControl/EOKeyGlobalID.m @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2006 SKYRIX Software AG + Copyright (C) 2006 Helge Hess This file is part of SOPE. @@ -39,8 +40,15 @@ kid->entityName = [_name copyWithZone:_zone]; kid->count = _count; - for (i = 0; i < _count; i++) + for (i = 0; i < _count; i++) { +#if DEBUG + if (_keyValues[i] == nil) { + NSLog(@"WARN(%s): got 'nil' as a EOKeyGlobalID value (entity=%@)!", + __PRETTY_FUNCTION__, _name); + } +#endif kid->values[i] = [_keyValues[i] retain]; + } return [kid autorelease]; } @@ -146,10 +154,20 @@ self, NSStringFromClass([self class]), [self entityName]]; - for (i = 0; i < self->count; i++) { - if (i == 0) [s appendString:@" "]; - else [s appendString:@"/"]; - [s appendString:[self->values[i] stringValue]]; + if (self->count == 0) { + [s appendString:@" no-key-values"]; + } + else { + for (i = 0; i < self->count; i++) { + if (i == 0) [s appendString:@" "]; + else [s appendString:@"/"]; + if (self->values[i] == nil) + [s appendString:@""]; + else if (self->values[i] == nil) + [s appendString:@""]; + else + [s appendString:[self->values[i] stringValue]]; + } } [s appendString:@">"]; diff --git a/sope-core/EOControl/Version b/sope-core/EOControl/Version index afdeafc4..f4e13957 100644 --- a/sope-core/EOControl/Version +++ b/sope-core/EOControl/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=67 +SUBMINOR_VERSION:=68