Skip to content

Commit 7cb304b

Browse files
committed
Fix undefined 'window' error in Web Worker and Node.js environments
1 parent 261fe8b commit 7cb304b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/display/canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ class CanvasGraphics {
718718
// foreground: '#D8DEE9',
719719
// };
720720

721-
if (window.theme && !this.ctx.skipBlender) {
721+
if (typeof window !== 'undefined' && window.theme && !this.ctx.skipBlender) {
722722
this.blender = new Blender(this.ctx, window.theme);
723723
}
724724
// For pdfs that use blend modes we have to clear the canvas else certain

0 commit comments

Comments
 (0)