diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-09-04 08:54:56 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-09-04 08:54:56 +0200 |
| commit | 7bceb6e41b1b5bea585b4e2e3840e50bcb17787a (patch) | |
| tree | ccc04734ed4abed1560b71e46efc0dd037050558 /src/student-prod.ts | |
| parent | fd40558a7eadfc016197fec782d9a3b2a3f84825 (diff) | |
| download | bycs-sol-7bceb6e41b1b5bea585b4e2e3840e50bcb17787a.tar.gz bycs-sol-7bceb6e41b1b5bea585b4e2e3840e50bcb17787a.zip | |
student: test for an empty or nil students list
Diffstat (limited to 'src/student-prod.ts')
| -rw-r--r-- | src/student-prod.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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)) { |
