From 64ceccf7803403ad1379413807a006e5221a3100 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Sun, 19 May 2019 12:01:48 +0200 Subject: [PATCH] Ensure that nogo weight is not null nor undefined before using it --- js/router/BRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/router/BRouter.js b/js/router/BRouter.js index 0d3e148..ea9eab2 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -40,7 +40,6 @@ L.BRouter = L.Class.extend({ getUrlParams: function(latLngs, format) { params = {}; - if (this._getLonLatsString(latLngs) != null) params.lonlats = this._getLonLatsString(latLngs); @@ -269,6 +268,7 @@ L.BRouter = L.Class.extend({ // -1 is default nogo exclusion, it should not be passed as a URL parameter. if ( circle.options.nogoWeight !== null && + circle.options.nogoWeight !== undefined && circle.options.nogoWeight !== -1 ) { s += L.BRouter.NUMBER_SEPARATOR;