]> git.parisson.com Git - pdf.js.git/commitdiff
Fix strict javascript warning in CanvasGraphics.
authorKalervo Kujala <kkujala@com>
Thu, 20 Oct 2011 20:56:23 +0000 (23:56 +0300)
committerKalervo Kujala <kkujala@com>
Thu, 20 Oct 2011 20:56:23 +0000 (23:56 +0300)
pdf.js

diff --git a/pdf.js b/pdf.js
index 378c17580f3c9ff7e303cb359a85c0d64723c56d..4403855637e9a1b1c42d9365b64d7aaa9237fa41 100644 (file)
--- 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);