Skip to content
Snippets Groups Projects
Commit c3ae67d5 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

fail proof event creation for consultation slot, fixes #691

parent 295da81d
No related branches found
No related tags found
No related merge requests found
...@@ -222,7 +222,12 @@ class ConsultationSlot extends SimpleORMap ...@@ -222,7 +222,12 @@ class ConsultationSlot extends SimpleORMap
// Add events for missing responsible users // Add events for missing responsible users
$missing = array_diff($responsible_ids, $this->events->pluck('user_id')); $missing = array_diff($responsible_ids, $this->events->pluck('user_id'));
foreach ($missing as $user_id) { foreach ($missing as $user_id) {
$event = $this->createEvent(User::find($user_id)); $user = User::find($user_id);
if (!$user) {
continue;
}
$event = $this->createEvent($user);
ConsultationEvent::create([ ConsultationEvent::create([
'slot_id' => $this->id, 'slot_id' => $this->id,
'user_id' => $user_id, 'user_id' => $user_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment