Tasks: Make gettasks more robust against malformed VTODO data

This commit is contained in:
Bart Visscher 2012-04-20 18:18:07 +02:00
parent c75bbb59a9
commit 70ba428222

View file

@ -26,7 +26,11 @@ foreach( $calendars as $calendar ){
}
$object = OC_VObject::parse($task['calendardata']);
$vtodo = $object->VTODO;
$tasks[] = OC_Task_App::arrayForJSON($task['id'], $vtodo, $user_timezone);
try {
$tasks[] = OC_Task_App::arrayForJSON($task['id'], $vtodo, $user_timezone);
} catch(Exception $e) {
OC_Log::write('tasks', $e->getMessage(), OC_Log::ERROR);
}
}
}