Skip to content

Commit eeee760

Browse files
committed
mapbox: fix loc.context.length undefined
Fixes #254.
1 parent f177fdc commit eeee760

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/geocoders/mapbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export var Mapbox = L.Class.extend({
4646
address: loc.address
4747
};
4848

49-
for (var j = 0; j < loc.context.length; j++) {
49+
for (var j = 0; j < (loc.context || []).length; j++) {
5050
var id = loc.context[j].id.split('.')[0];
5151
properties[id] = loc.context[j].text;
5252
}

0 commit comments

Comments
 (0)