Skip to content

Commit

Permalink
If locationSet is missing include, default to worldwide include
Browse files Browse the repository at this point in the history
  • Loading branch information
bhousel committed Jul 12, 2021
1 parent f42b803 commit d4eaa36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/core/locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ export function coreLocations() {
if (obj.locationSetID) return; // work was done already

try {
const locationSet = obj.locationSet;
let locationSet = obj.locationSet;
if (!locationSet) {
throw new Error('object missing locationSet property');
}
if (!locationSet.include) { // missing `include`, default to worldwide include
locationSet.include = ['Q2']; // https://github.com/openstreetmap/iD/pull/8305#discussion_r662344647
}
const resolved = _loco.resolveLocationSet(locationSet);
const locationSetID = resolved.id;
obj.locationSetID = locationSetID;
Expand Down

0 comments on commit d4eaa36

Please sign in to comment.