diff --git a/ChangeLog b/ChangeLog index 5b25ba9aa..df2a1dbfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-11-14 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoTaskObject.m: same as below... + + * SoObjects/Appointments/SOGoAppointmentObject.m: lookupName:... + might return an exception so we have to handle it if we don't + wanna crash... + 2006-11-13 Wolfgang Sourdeau * UI/WebServerResources/SchedulerUI.js: updated the list diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 7bd227af4..d0bfda31e 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -213,9 +213,18 @@ static NSString *mailTemplateDefaultLanguage = nil; if (![folder isNotNull]) /* no folder was found for given UID */ continue; - - apt = [folder lookupName:[self nameInContainer] inContext:ctx - acquire:NO]; + + apt = [folder lookupName: [self nameInContainer] inContext:ctx + acquire: NO]; + if ([apt isKindOfClass: [NSException class]]) + { + [self logWithFormat:@"Note: an exception occured finding '%@' in folder: %@", + [self nameInContainer], folder]; + [self logWithFormat:@"the exception reason was: %@", + [(NSException *) apt reason]]; + continue; + } + if (![apt isNotNull]) { [self logWithFormat:@"Note: did not find '%@' in folder: %@", [self nameInContainer], folder]; diff --git a/SoObjects/Appointments/SOGoTaskObject.m b/SoObjects/Appointments/SOGoTaskObject.m index 2c64862e7..27a4bdfbb 100644 --- a/SoObjects/Appointments/SOGoTaskObject.m +++ b/SoObjects/Appointments/SOGoTaskObject.m @@ -207,20 +207,29 @@ static NSString *mailTemplateDefaultLanguage = nil; objectEnumerator]; while ((folder = [e nextObject]) != nil) { NSException *error; - SOGoTaskObject *apt; + SOGoTaskObject *task; if (![folder isNotNull]) /* no folder was found for given UID */ continue; - apt = [folder lookupName:[self nameInContainer] inContext:ctx + task = [folder lookupName:[self nameInContainer] inContext:ctx acquire:NO]; - if (![apt isNotNull]) { + if ([task isKindOfClass: [NSException class]]) + { + [self logWithFormat:@"Note: an exception occured finding '%@' in folder: %@", + [self nameInContainer], folder]; + [self logWithFormat:@"the exception reason was: %@", + [(NSException *) task reason]]; + continue; + } + + if (![task isNotNull]) { [self logWithFormat:@"Note: did not find '%@' in folder: %@", [self nameInContainer], folder]; continue; } - if ((error = [apt primarySaveContentString:_iCal]) != nil) { + if ((error = [task primarySaveContentString:_iCal]) != nil) { [self logWithFormat:@"Note: failed to save iCal in folder: %@", folder]; // TODO: make compound allErrors = error; @@ -240,17 +249,17 @@ static NSString *mailTemplateDefaultLanguage = nil; objectEnumerator]; while ((folder = [e nextObject])) { NSException *error; - SOGoTaskObject *apt; + SOGoTaskObject *task; - apt = [folder lookupName:[self nameInContainer] inContext:ctx + task = [folder lookupName:[self nameInContainer] inContext:ctx acquire:NO]; - if (![apt isNotNull]) { + if (![task isNotNull]) { [self logWithFormat:@"Note: did not find '%@' in folder: %@", [self nameInContainer], folder]; continue; } - if ((error = [apt primaryDelete]) != nil) { + if ((error = [task primaryDelete]) != nil) { [self logWithFormat:@"Note: failed to delete in folder: %@", folder]; // TODO: make compound allErrors = error;