return $result;
}
try {
- $tasklist = $GLOBALS['registry']->tasks->addTasklist($calendar['name'], $calendar['description'], $calendar['color']);
+ $tasklistId = $GLOBALS['registry']->tasks->addTasklist($calendar['name'], $calendar['description'], $calendar['color']);
+ $tasklists = $GLOBALS['registry']->tasks->listTasklists(true);
+ if (!isset($tasklists[$tasklistId])) {
+ $GLOBALS['notification']->push(_("Added task list not found."), 'horde.error');
+ return $result;
+ }
+ $tasklist = $tasklists[$tasklistId];
Kronolith::readPermsForm($tasklist);
$result->perms = Kronolith::permissionToJson($tasklist->getPermission());
} catch (Exception $e) {