From 0b9464f0177704c339ccc5525b51fcc7405e9c8e Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Thu, 1 Jun 2017 10:20:08 -0500 Subject: [PATCH] Fixes #5534 by adding a check for null. (#5535) --- src/layer/marker/Icon.Default.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/layer/marker/Icon.Default.js b/src/layer/marker/Icon.Default.js index 107929f6..33d67ccd 100644 --- a/src/layer/marker/Icon.Default.js +++ b/src/layer/marker/Icon.Default.js @@ -49,7 +49,12 @@ export var IconDefault = Icon.extend({ document.body.removeChild(el); - return path.indexOf('url') === 0 ? - path.replace(/^url\([\"\']?/, '').replace(/marker-icon\.png[\"\']?\)$/, '') : ''; + if (path === null || path.indexOf('url') !== 0) { + path = ''; + } else { + path.replace(/^url\([\"\']?/, '').replace(/marker-icon\.png[\"\']?\)$/, ''); + } + + return path; } });