Skip to content

Commit

Permalink
fix(avatarcropper): 报错 (#2364)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang authored Jul 2, 2024
1 parent 82c05a9 commit 642285b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/packages/avatarcropper/avatarcropper.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
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
Expand Down

0 comments on commit 642285b

Please sign in to comment.