From 13407465f3a9ef04253d96aa63e919c825c44461 Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Tue, 21 May 2019 18:10:28 +0200 Subject: [PATCH] Ensure not undefined for polylines and polygons also (#183) Which is the case when parsing polylines/polygons URL parameter without weight. --- js/router/BRouter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/router/BRouter.js b/js/router/BRouter.js index 834c5c2..7a5357a 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -271,8 +271,8 @@ L.BRouter = L.Class.extend({ s += Math.round(circle.getRadius()); // -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 !== null && circle.options.nogoWeight !== -1 ) { s += L.BRouter.NUMBER_SEPARATOR; @@ -324,6 +324,7 @@ L.BRouter = L.Class.extend({ } // -1 is default nogo exclusion, it should not be passed as a URL parameter. if ( + polyline.options.nogoWeight !== undefined && polyline.options.nogoWeight !== null && polyline.options.nogoWeight !== -1 ) { @@ -376,6 +377,7 @@ L.BRouter = L.Class.extend({ } // -1 is default nogo exclusion, it should not be passed as a URL parameter. if ( + polygon.options.nogoWeight !== undefined && polygon.options.nogoWeight !== null && polygon.options.nogoWeight !== -1 ) {