Skip to content

Commit f813f9d

Browse files
committed
Fix error without marker.json
1 parent e91bb8a commit f813f9d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

BlueMapCore/src/main/webroot/js/libs/hud/MarkerManager.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default class MarkerManager {
1313

1414
this.readyPromise =
1515
this.loadMarkerData()
16-
.then(this.loadMarkers);
16+
.catch(ignore => {})
17+
.then(this.loadMarkers);
1718

1819
$(document).on('bluemap-map-change', this.onBlueMapMapChange);
1920
}
@@ -34,9 +35,11 @@ export default class MarkerManager {
3435
}
3536

3637
loadMarkers = () => {
37-
this.markerData.markerSets.forEach(setData => {
38-
this.markerSets.push(new MarkerSet(this.blueMap, setData));
39-
});
38+
if (this.markerData && this.markerData.markerSets) {
39+
this.markerData.markerSets.forEach(setData => {
40+
this.markerSets.push(new MarkerSet(this.blueMap, setData));
41+
});
42+
}
4043
};
4144

4245
update(){

0 commit comments

Comments
 (0)