prevent errors for recurring #33kfqf6

This commit is contained in:
Denis Duliçi 2022-11-14 00:20:04 +03:00
parent a3ad10f3bc
commit d64353d656

View File

@ -188,7 +188,11 @@ trait Recurring
return false; return false;
} }
return $schedule->current()->getStart(); if (! $current = $schedule->current()) {
return false;
}
return $current->getStart();
} }
public function getNextRecurring() public function getNextRecurring()
@ -210,7 +214,11 @@ trait Recurring
return false; return false;
} }
return $schedule->first()->getStart(); if (! $first = $schedule->first()) {
return false;
}
return $first->getStart();
} }
public function getLastRecurring() public function getLastRecurring()
@ -219,6 +227,10 @@ trait Recurring
return false; return false;
} }
return $schedule->last()->getStart(); if (! $last = $schedule->last()) {
return false;
}
return $last->getStart();
} }
} }