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

fail proof event creation for consultation slot, fixes #691

parent 58f33ff0
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,12 @@ class ConsultationSlot extends SimpleORMap
// Add events for missing responsible users
$missing = array_diff($responsible_ids, $this->events->pluck('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([
'slot_id' => $this->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