Skip to content

Commit

Permalink
Add null check to getNewCanvasAndCtx
Browse files Browse the repository at this point in the history
Resolves #18
  • Loading branch information
Cho, Yongjoon authored and Donaldcwl committed Mar 14, 2020
1 parent b542519 commit c430896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export function getNewCanvasAndCtx (width, height) {
canvas = new OffscreenCanvas(width, height)
ctx = canvas.getContext('2d')
if (ctx === null) {
throw new Error('getContext of OffscreenCanvas returns null')
throw new Error("getContext of OffscreenCanvas returns null")
}
} catch (e) {
canvas = document.createElement('canvas')
Expand Down

0 comments on commit c430896

Please sign in to comment.