From 7b104ffe940b9919f4d986c3c5ee9349c60f0847 Mon Sep 17 00:00:00 2001 From: Hazel K Date: Sun, 29 Sep 2024 23:22:58 -0400 Subject: [PATCH] fix crash during startup --- packages/backend/src/models/LatestNote.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/models/LatestNote.ts b/packages/backend/src/models/LatestNote.ts index 4b81c46d43..4a712c8e20 100644 --- a/packages/backend/src/models/LatestNote.ts +++ b/packages/backend/src/models/LatestNote.ts @@ -39,7 +39,9 @@ export class LatestNote { }) public note: MiNote | null; - constructor(data: Partial) { + constructor(data?: Partial) { + if (!data) return; + for (const [k, v] of Object.entries(data)) { (this as Record)[k] = v; }