From d4665979b80a26ff50ee0af6144b2d45e991bd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 22 Sep 2021 08:29:04 +0200 Subject: [PATCH] Fix resizer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/resizer/resizer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resizer/resizer.ts b/src/resizer/resizer.ts index aa1fb09e0c..b090214312 100644 --- a/src/resizer/resizer.ts +++ b/src/resizer/resizer.ts @@ -130,7 +130,7 @@ export default class Resizer { // mark as currently resizing if (this.classNames.resizing) { - this.container.classList.add(this.classNames.resizing); + this.container?.classList?.add(this.classNames.resizing); } if (this.config.onResizeStart) { this.config.onResizeStart(); @@ -147,7 +147,7 @@ export default class Resizer { const body = document.body; const finishResize = () => { if (this.classNames.resizing) { - this.container.classList.remove(this.classNames.resizing); + this.container?.classList?.remove(this.classNames.resizing); } distributor.finish(); if (this.config.onResizeStop) { @@ -194,7 +194,7 @@ export default class Resizer { if (this?.config?.handler) { return [this.config.handler]; } - if (!this.container.children) return []; + if (!this.container?.children) return []; return Array.from(this.container.querySelectorAll(`.${this.classNames.handle}`)) as HTMLElement[]; } }