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)}`;