From 27719772b50adb162ee51f773ba93aa6b9381d5d Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Mon, 2 Mar 2026 20:28:43 +0000 Subject: Fix: #5327 - Lifespan chart errors when no dates available --- app/Module/LifespansChartModule.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php index 64d7ee3ebc..6028640680 100644 --- a/app/Module/LifespansChartModule.php +++ b/app/Module/LifespansChartModule.php @@ -285,6 +285,11 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac return $carry; }, 0); + // No dates? Show the current year. + if ($jd === 0) { + return (int) date('Y'); + } + $year = $this->jdToYear($jd); // Don't show future dates @@ -308,6 +313,11 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac return $carry; }, PHP_INT_MAX); + // No dates? Show the current year. + if ($jd === PHP_INT_MAX) { + return (int) date('Y'); + } + return $this->jdToYear($jd); } -- cgit v1.3