Merge pull request #185 from bagage/fix-nogo-undefined

Ensure that nogo weight is not null nor undefined before using it
This commit is contained in:
Norbert Renner 2019-05-20 20:38:32 +02:00 committed by GitHub
commit 61b82cdcc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;