From d591d8e66b4b1d73531575eec3a3ccc313e52a6a Mon Sep 17 00:00:00 2001 From: Tudor Sitaru Date: Wed, 1 Apr 2026 16:07:28 +0100 Subject: [PATCH] fix(utils): handle null year in formatAcademicYear Co-Authored-By: Claude Opus 4.6 --- nextjs-app/lib/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nextjs-app/lib/utils.ts b/nextjs-app/lib/utils.ts index a0d1823..f052b41 100644 --- a/nextjs-app/lib/utils.ts +++ b/nextjs-app/lib/utils.ts @@ -383,7 +383,8 @@ export function getPhaseStyle(phase?: string | null): { key: string; label: stri } } -export function formatAcademicYear(year: number): string { +export function formatAcademicYear(year: number | null | undefined): string { + if (year == null) return ''; const s = year.toString(); if (s.length === 6) { return `${s.slice(0, 4)}/${s.slice(4)}`;