From 7da3c68c48a4e3351fca50e049f6c0e44e23b26a Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Thu, 20 Oct 2011 23:56:23 +0300 Subject: [PATCH] Fix strict javascript warning in CanvasGraphics. --- pdf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdf.js b/pdf.js index 378c17580..440385563 100644 --- a/pdf.js +++ b/pdf.js @@ -5649,8 +5649,9 @@ var CanvasGraphics = (function canvasGraphics() { var tmpCtx = tmpCanvas.getContext('2d'); if (imageObj.imageMask) { var fillColor = this.current.fillColor; - tmpCtx.fillStyle = (fillColor && fillColor.type === 'Pattern') ? - fillColor.getPattern(tmpCtx) : fillColor; + tmpCtx.fillStyle = (fillColor && fillColor.hasOwnProperty('type') && + fillColor.type === 'Pattern') ? + fillColor.getPattern(tmpCtx) : fillColor; tmpCtx.fillRect(0, 0, w, h); } var imgData = tmpCtx.getImageData(0, 0, w, h);