From 61194c9c99db7d3787505cb6f398600f252dfa82 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 23 Feb 2022 13:58:32 +0000 Subject: [PATCH] Fix error when marker set is removed when changing between maps on the same world --- src/components/map/marker/Markers.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/map/marker/Markers.vue b/src/components/map/marker/Markers.vue index c984c8c..bb4315a 100644 --- a/src/components/map/marker/Markers.vue +++ b/src/components/map/marker/Markers.vue @@ -82,10 +82,13 @@ export default defineComponent({ watch(currentMap, (newValue, oldValue) => { if(newValue && (!oldValue || oldValue.world === newValue.world)) { - converter = newValue.locationToLatLng.bind(newValue); + //Prevent error if this marker set has just been removed due to the map change + if(nonReactiveState.markers.has(props.set.id)) { + converter = newValue.locationToLatLng.bind(newValue); - for (const [id, area] of nonReactiveState.markers.get(props.set.id)!) { - updateMarkerLayer(layers.get(id), area, converter); + for (const [id, area] of nonReactiveState.markers.get(props.set.id)!) { + updateMarkerLayer(layers.get(id), area, converter); + } } } });