]> err.no Git - scalable-opengroupware.org/commitdiff
appointment save is broken
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 9 Nov 2004 14:42:58 +0000 (14:42 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 9 Nov 2004 14:42:58 +0000 (14:42 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@448 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Appointments/ChangeLog
SOGo/SoObjects/Appointments/SOGoAppointmentObject.m
SOGo/SoObjects/Appointments/Version

index e6ff7181d406ea8d2f244ea353467caf81be7da9..b727ad48846291d3002ce1f79d86924acbe54e1f 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-09  Helge Hess  <helge.hess@skyrix.com>
+
+       * SOGoAppointmentObject.m: improved error handling in save method
+         (v0.9.16)
+
 2004-10-20  Helge Hess  <helge.hess@opengroupware.org>
 
        * SOGoAppointmentFolder.m: fixed a warning on MacOSX (v0.9.15)
index d7ffe5b7e3e1c035bf9e3325aeb076d633b91277..9da8460392b07c04894bde6886f2d7ec534f3c10 100644 (file)
   unsigned        i, count;
   NSException     *storeError, *delError;
   
+  if ([_iCal length] == 0) {
+    return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
+                       reason:@"got no iCalendar content to store!"];
+  }
+  
   /* handle old content */
   
   oldContent = [self iCalString]; /* if nil, this is a new appointment */
   if ([oldContent length] == 0) {
     /* new appointment */
-    [self debugWithFormat:@"saving new appointment ..."];
+    [self debugWithFormat:@"saving new appointment: %@", _iCal];
     oldApt = nil;
   }
   else {
   /* handle new content */
   
   newApt  = [[[SOGoAppointment alloc] initWithICalString:_iCal] autorelease];
-  newUIDs = [self attendeeUIDsFromAppointment:newApt];
+  if (newApt == nil) {
+    return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
+                       reason:@"could not parse iCalendar content!"];
+  }
+  if ((newUIDs = [self attendeeUIDsFromAppointment:newApt]) == nil)
+    [self debugWithFormat:@"got no UIDs from appointment: %@", newApt];
   
   /* diff */
   
     /* new ID which is not part of the old set => store a new */
     [storeUIDs addObject:uid];
   }
-
-  [self debugWithFormat:@"store:  %@", storeUIDs];
-  [self debugWithFormat:@"remove: %@", removedUIDs];
+  
+  [self debugWithFormat:
+         @"UID ops:\n  new: %@\n  old: %@\n  store: %@\n  remove: %@",
+         newUIDs, oldUIDs, storeUIDs, removedUIDs];
   
   /* perform */
   
index 8c1adff0f65eee7be3f2a8067ee3b6141d149f38..87351aca8ccce9eee61cc5f3452720f2012e0376 100644 (file)
@@ -1,5 +1,5 @@
 # Version file
 
-SUBMINOR_VERSION:=15
+SUBMINOR_VERSION:=16
 
 # v0.9.13 requires libSOGo v0.9.26