From 9ef0d0b878441aa9ad0dbad3cbce9802cc7bad6d Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 14 Aug 2014 16:29:10 +0200 Subject: [PATCH] Fix the error handling for CMaps that fail to load --- src/core/cmap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/cmap.js b/src/core/cmap.js index 1cdaa030d..5d69d17cb 100644 --- a/src/core/cmap.js +++ b/src/core/cmap.js @@ -387,7 +387,7 @@ var BinaryCMapReader = (function BinaryCMapReaderClosure() { request.overrideMimeType('text/plain; charset=x-user-defined'); } request.send(null); - if (request.status === 0 && /^https?:/i.test(url)) { + if (nonBinaryRequest ? !request.responseText : !request.response) { error('Unable to get binary cMap at: ' + url); } if (nonBinaryRequest) { @@ -927,7 +927,7 @@ var CMapFactory = (function CMapFactoryClosure() { var url = builtInCMapParams.url + name; request.open('GET', url, false); request.send(null); - if (request.status === 0 && /^https?:/i.test(url)) { + if (!request.responseText) { error('Unable to get cMap at: ' + url); } var cMap = new CMap(true);