From e5a3a3bfcab79ba9eead23f6e023fc41053c65e3 Mon Sep 17 00:00:00 2001 From: thomasync Date: Thu, 19 Sep 2024 14:17:07 +0200 Subject: [PATCH] fix: check if today_button is defined before use it --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a2a76748..9fc52ee3 100644 --- a/src/index.js +++ b/src/index.js @@ -540,7 +540,9 @@ export default class Gantt { 'px'; // Update the left value on page resize - this.$today_button.style.left = `${containerRect.left + 20}px`; + if (this.$today_button) { + this.$today_button.style.left = `${containerRect.left + 20}px`; + } } make_grid_ticks() {