Make sure there is a calendar after delete.

This commit is contained in:
Thomas Tanghus 2012-06-15 02:10:55 +02:00
parent 3c75ac5f62
commit f6aa366857
1 changed files with 4 additions and 0 deletions

View File

@ -198,6 +198,10 @@ class OC_Calendar_Calendar{
$stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE calendarid = ?' );
$stmt->execute(array($id));
if(count(self::allCalendars()) == 0) {
self::addCalendar(OCP\USER::getUser(),'Default calendar');
}
return true;
}