From 642285ba7b609d34f466fc85885367488670bdd9 Mon Sep 17 00:00:00 2001 From: "Alex.huxiyang" <1872591453@qq.com> Date: Tue, 2 Jul 2024 17:06:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(avatarcropper):=20=E6=8A=A5=E9=94=99=20(#23?= =?UTF-8?q?64)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/avatarcropper/avatarcropper.taro.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/packages/avatarcropper/avatarcropper.taro.tsx b/src/packages/avatarcropper/avatarcropper.taro.tsx index 7730883a33..2f6b3f0a66 100644 --- a/src/packages/avatarcropper/avatarcropper.taro.tsx +++ b/src/packages/avatarcropper/avatarcropper.taro.tsx @@ -272,6 +272,7 @@ export const AvatarCropper: FunctionComponent> = ( if (canvasDom?.tagName !== 'CANVAS') { canvas = canvasDom?.getElementsByTagName('canvas')[0] as HTMLCanvasElement } + if (!canvas) return canvas.width = state.displayWidth canvas.height = state.displayHeight const ctx = canvas.getContext('2d') as CanvasRenderingContext2D