RETV_IF(NULL == b, CALENDAR_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
+ bool valid_count = 0;
int ret = CALENDAR_ERROR_NONE;
calendar_record_h record = NULL;
DBG("uri[%s]", uri);
if (CAL_STRING_EQUAL == strcmp(uri, _calendar_event._uri)) {
+ valid_count++;
b->type = CALENDAR_BOOK_TYPE_EVENT;
__devide_vcalendar_with_header(b, record);
_cal_vcalendar_make_schedule(b, record);
} else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_todo._uri)) {
+ valid_count++;
b->type = CALENDAR_BOOK_TYPE_TODO;
__devide_vcalendar_with_header(b, record);
_cal_vcalendar_make_schedule(b, record);
}
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
+
+ if (0 == valid_count) {
+ DBG("There is no valid records");
+ return CALENDAR_ERROR_INVALID_PARAMETER;
+ }
+
__make_footer(b);
return CALENDAR_ERROR_NONE;
b->version = version;
DBG("make as version(%d)", version);
- __make_vcalendar(b, list);
- return CALENDAR_ERROR_NONE;
+ return __make_vcalendar(b, list);
}