Skip to content

Commit 8a7a58f

Browse files
author
xuying.xu
committed
fix: 增加判空
1 parent bcaa434 commit 8a7a58f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/f-my/src/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,11 @@ Component({
175175
isMouseEvent: (e) => e.type.startsWith('mouse'),
176176
});
177177
this.canvas = canvas;
178-
// @ts-ignore g里面caf透传不了,暂时解决
179-
canvas.canvas.context.config.cancelAnimationFrame = cancelAnimationFrame;
178+
// @ts-ignore
179+
if (canvas.canvas?.context?.config) {
180+
// @ts-ignore g里面caf透传不了,暂时解决
181+
canvas.canvas.context.config.cancelAnimationFrame = cancelAnimationFrame;
182+
}
180183
this.canvasEl = canvas.getCanvasEl();
181184
return canvas;
182185
},

0 commit comments

Comments
 (0)