mapbox / mapbox.js

Mapbox JavaScript API, a Leaflet Plugin
mapbox.com/mapbox.js/
Other
1.91k stars 386 forks source link

Source url could be undefined -- check before calling `.split` or performing other operations on it #1333

Open jseppi opened 3 years ago

jseppi commented 3 years ago

On this line in _getAttribution: https://github.com/mapbox/mapbox.js/blob/1db88e7bf25b2bd2cd940a264b557cf4a41c43d8/src/style_layer.js#L33

Each source url has .split() called on it. If a source without a url property (such as a geojson source) is present in the style, this line will cause an uncaught error.

jseppi commented 3 years ago

Potentially the same issue as https://github.com/mapbox/mapbox.js/issues/1295