Skip to content

Commit

Permalink
CycleController.php avoid undefined property
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimimo committed Apr 13, 2023
1 parent bc163d2 commit 5f5fafa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Http/Controllers/CycleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ private function getLastWeek(bool $return_date = false): int|PoolDate
$dates = $this->getCalendar();
$returnDate = null;
//if this a brand-new cycle, without events, put week played to 0
if (! count($dates->first()->events)) {
/** @var PoolDate $first */
$first = $dates->first();
if (! count($first->events)) {
return 0;
}
$week = 0;
Expand Down

0 comments on commit 5f5fafa

Please sign in to comment.