Skip to content

Commit

Permalink
Catch if a resource has been removed in the meantime.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Mar 7, 2016
1 parent ff433d0 commit b594c15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion kronolith/attendees.php
Expand Up @@ -253,7 +253,11 @@
if (count($resources)) {
$driver = Kronolith::getDriver('Resource');
foreach ($resources as $r_id => $resource) {
$r = $driver->getResource($r_id);
try {
$r = $driver->getResource($r_id);
} catch (Horde_Exception_NotFound $e) {
continue;
}
try {
$vfb = $r->getFreeBusy(null, null, true);
if ($resource['attendance'] == Kronolith::PART_REQUIRED) {
Expand Down
6 changes: 5 additions & 1 deletion kronolith/lib/Resource/Group.php
Expand Up @@ -102,7 +102,11 @@ public function isFree(Kronolith_Event $event)
/* Iterate over all resources until one with no conflicts is found */
foreach ($resources as $resource_id) {
$conflict = false;
$resource = $this->_driver->getResource($resource_id);
try {
$resource = $this->_driver->getResource($resource_id);
} catch (Horde_Exception_NotFound $e) {
continue;
}
$busy = Kronolith::getDriver('Resource', $resource->get('calendar'))
->listEvents($start, $end, array('show_recurrence' => true));

Expand Down

0 comments on commit b594c15

Please sign in to comment.