From 7fb6a3db5b1c61a6f600b9c6770d792e9e7eb183 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 8 Aug 2014 15:55:52 -0700 Subject: [PATCH] prevent glyph loading errors from blocking tiles ref #662 --- js/symbol/glyphsource.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/symbol/glyphsource.js b/js/symbol/glyphsource.js index e3cbefa2929..288216296bd 100644 --- a/js/symbol/glyphsource.js +++ b/js/symbol/glyphsource.js @@ -93,12 +93,11 @@ GlyphSource.prototype.loadRange = function(fontstack, range, callback) { var url = glyphUrl(fontstack, rangeName, this.url); getArrayBuffer(url, function(err, data) { - if (err) return callback(err); - var glyphs = new Glyphs(new Protobuf(new Uint8Array(data))); + var glyphs = !err && new Glyphs(new Protobuf(new Uint8Array(data))); for (var i = 0; i < loading[range].length; i++) { - loading[range][i](undefined, range, glyphs); + loading[range][i](err, range, glyphs); } - delete loading[range][i]; + delete loading[range]; }); } };