From d4eaa3615776503e3f6b8f6bfe00ab7ca98ba3a4 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 2 Jul 2021 10:03:44 -0400 Subject: [PATCH] If locationSet is missing `include`, default to worldwide include https://github.com/openstreetmap/iD/pull/8305#discussion_r662344647 --- modules/core/locations.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/core/locations.js b/modules/core/locations.js index 6295074df2..49e4daa431 100644 --- a/modules/core/locations.js +++ b/modules/core/locations.js @@ -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;