From e4503ee5ce3070251e0027757b24efbac27bcccb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 15 Nov 2006 00:04:17 +0000 Subject: [PATCH] Monotone-Parent: 9fe3529f7c302f3b3b2e565e15ab9d4dabc1943d Monotone-Revision: c6656aa775a801327ce3bc9f18ca6dbd56e6776d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-15T00:04:17 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++ .../Appointments/SOGoAppointmentObject.m | 15 ++++++++--- SoObjects/Appointments/SOGoTaskObject.m | 25 +++++++++++++------ 3 files changed, 37 insertions(+), 11 deletions(-) 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;