We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82c05a9 commit 642285bCopy full SHA for 642285b
src/packages/avatarcropper/avatarcropper.taro.tsx
@@ -272,6 +272,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
272
if (canvasDom?.tagName !== 'CANVAS') {
273
canvas = canvasDom?.getElementsByTagName('canvas')[0] as HTMLCanvasElement
274
}
275
+ if (!canvas) return
276
canvas.width = state.displayWidth
277
canvas.height = state.displayHeight
278
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D
0 commit comments