NSNumber *now;
NSString *qsql, *bsql;
+ /* check preconditions */
+
+ if (_name == nil) {
+ return [NSException exceptionWithName:@"OCSStoreException"
+ reason:@"no content filename was provided"
+ userInfo:nil];
+ }
+ if (_content == nil) {
+ return [NSException exceptionWithName:@"OCSStoreException"
+ reason:@"no content was provided"
+ userInfo:nil];
+ }
+
#warning TODO: properly escape SQL specials!
error = nil;
- (NSString *)stringForAppointment:(SOGoAppointment *)_apt {
NSMutableString *s;
+ if (_apt == nil)
+ return nil;
+
if ([[_apt uid] length] == 0) {
- [self logWithFormat:@"WARNING: got apt without uid, rejecting iCal gen."];
+ [self logWithFormat:
+ @"WARNING: got apt without uid, rejecting iCal generation: %@",
+ _apt];
return nil;
}
if ([[[_apt startDate] icalString] length] == 0) {
[self logWithFormat:
- @"WARNING: got apt without startdate, rejecting iCal gen."];
+ @"WARNING: got apt without start date, "
+ @"rejecting iCal generation: %@",
+ _apt];
return nil;
}