From 8c6b137fdccea52aa2bb3bcaf317b1595abd5171 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 16 Nov 2023 15:21:39 +0800 Subject: [PATCH] fix: el null check --- src/canvas/Layer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/canvas/Layer.ts b/src/canvas/Layer.ts index ed67e8622..43a512f71 100644 --- a/src/canvas/Layer.ts +++ b/src/canvas/Layer.ts @@ -311,7 +311,7 @@ export default class Layer extends Eventful { * rect if and only if it's not painted this frame and was * previously painted on the canvas. */ - const shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true); + const shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true); if (el && (!shouldPaint || !el.__zr) && el.__isRendered) { // el was removed const prevRect = el.getPrevPaintRect();