From f346c40b7c346571480d7894551413cf7f7f9ab2 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Tue, 8 Apr 2025 14:00:42 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20crash=20when=20no?= =?UTF-8?q?=20calendarRoot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/app/widgets/buttons/calendar.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/public/app/widgets/buttons/calendar.ts b/src/public/app/widgets/buttons/calendar.ts index ddfccbdd5..a8b2d4542 100644 --- a/src/public/app/widgets/buttons/calendar.ts +++ b/src/public/app/widgets/buttons/calendar.ts @@ -213,6 +213,10 @@ export default class CalendarWidget extends RightDropdownButtonWidget { private async getWeekNoteEnable() { const noteId = await server.get(`search/${encodeURIComponent('#calendarRoot')}`); + if (noteId.length === 0) { + this.weekNoteEnable = false; + return; + } const noteAttributes = await server.get(`notes/${noteId}/attributes`); for (const attribute of noteAttributes) {