From f813f9d925baee80a25518b24e56265575122b36 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Mon, 20 Apr 2020 18:08:51 +0200 Subject: [PATCH] Fix error without marker.json --- .../src/main/webroot/js/libs/hud/MarkerManager.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/MarkerManager.js b/BlueMapCore/src/main/webroot/js/libs/hud/MarkerManager.js index b04621a9..1d4de058 100644 --- a/BlueMapCore/src/main/webroot/js/libs/hud/MarkerManager.js +++ b/BlueMapCore/src/main/webroot/js/libs/hud/MarkerManager.js @@ -13,7 +13,8 @@ export default class MarkerManager { this.readyPromise = this.loadMarkerData() - .then(this.loadMarkers); + .catch(ignore => {}) + .then(this.loadMarkers); $(document).on('bluemap-map-change', this.onBlueMapMapChange); } @@ -34,9 +35,11 @@ export default class MarkerManager { } loadMarkers = () => { - this.markerData.markerSets.forEach(setData => { - this.markerSets.push(new MarkerSet(this.blueMap, setData)); - }); + if (this.markerData && this.markerData.markerSets) { + this.markerData.markerSets.forEach(setData => { + this.markerSets.push(new MarkerSet(this.blueMap, setData)); + }); + } }; update(){