From 7bceb6e41b1b5bea585b4e2e3840e50bcb17787a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 4 Sep 2026 08:54:56 +0200 Subject: student: test for an empty or nil students list --- src/student-prod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/student-prod.ts b/src/student-prod.ts index 8b737f8..0dcbc71 100644 --- a/src/student-prod.ts +++ b/src/student-prod.ts @@ -61,7 +61,7 @@ async function fetchStudents(idFilter?: number, nameFilter?: string, groupFilter if (students === null) { const studentsPromise = _fetchStudents(); const storedStudents = localStorage.getItem("students"); - if (storedStudents) { + if (storedStudents !== null && storedStudents.length > 0) { studentsPromise.then((fetched) => localStorage.setItem("students", JSON.stringify(fetched))); students = []; for (const o of JSON.parse(storedStudents)) { -- cgit v1.2.3