Skip to content

Commit

Permalink
fix: el null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Nov 16, 2023
1 parent 1ee4156 commit 8c6b137
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/canvas/Layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8c6b137

Please sign in to comment.