From 8d196a96d067d71808d1aed03259cdabdab3fd03 Mon Sep 17 00:00:00 2001
From: sbarman <sbarman@L3CWZ5T.(none)>
Date: Sun, 3 Jul 2011 01:20:30 -0500
Subject: [PATCH] fix for colorspaces

---
 pdf.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pdf.js b/pdf.js
index 8f869a48a..7e47a3c57 100644
--- a/pdf.js
+++ b/pdf.js
@@ -4380,9 +4380,11 @@ var ColorSpace = (function() {
     constructor.parse = function colorspace_parse(cs, xref, res) {
         if (IsName(cs)) {
             var colorSpaces = res.get("ColorSpace");
-            var refcs = colorSpaces.get(cs.name);
-            if (refcs)
-                cs = refcs;
+            if (colorSpaces) {
+                var refcs = colorSpaces.get(cs.name);
+                if (refcs)
+                    cs = refcs;
+            }
         }
             
         cs = xref.fetchIfRef(cs);