From b7db23abb02965ff999e014e23960ea572733b2c Mon Sep 17 00:00:00 2001 From: ENT8R Date: Sun, 29 Oct 2023 13:59:32 +0100 Subject: [PATCH] :goal_net: Return early if there is no comment when searching for linked elements --- app/js/note.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/js/note.js b/app/js/note.js index 2ae2564..f4a4c6c 100644 --- a/app/js/note.js +++ b/app/js/note.js @@ -128,6 +128,10 @@ export default class Note { * @returns {Object} */ get linked() { + if (!('html' in this.comments[0])) { + return null; + } + for (const regex of OPENSTREETMAP_ELEMENT_REGEX) { const match = this.comments[0].html.match(regex);