From 46640e1408102d52f1924d2f26f7b38786add2c7 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 27 Feb 2022 18:40:29 +0100 Subject: [PATCH] optional --- frontend/src/scripts/db.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/scripts/db.ts b/frontend/src/scripts/db.ts index cc0d01e42..ac731d6a3 100644 --- a/frontend/src/scripts/db.ts +++ b/frontend/src/scripts/db.ts @@ -166,7 +166,7 @@ export async function getUserResults(): Promise { if (result.numbers === undefined) result.numbers = false; if (result.punctuation === undefined) result.punctuation = false; }); - dbSnapshot.results = results.sort((a, b) => b.timestamp - a.timestamp); + dbSnapshot.results = results?.sort((a, b) => b.timestamp - a.timestamp); return true; } }