diff --git a/app/assets/javascripts/index/layers/notes.js b/app/assets/javascripts/index/layers/notes.js index 24bf969b33..5391f3ef77 100644 --- a/app/assets/javascripts/index/layers/notes.js +++ b/app/assets/javascripts/index/layers/notes.js @@ -44,10 +44,13 @@ OSM.initializeNotesLayer = function (map) { marker.setIcon(noteIcons[feature.properties.status]); } else { let title; - const description = feature.properties.comments[0]; - if (description?.action === "opened") { - title = description.text; + if (feature.properties.comments.length > 0) { + const description = feature.properties.comments[0]; + + if (description?.action === "opened") { + title = description.text; + } } marker = L.marker(feature.geometry.coordinates.reverse(), {