Skip to content

Commit

Permalink
🥅 Return early if there is no comment when searching for linked elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ENT8R committed Oct 29, 2023
1 parent 3ad7031 commit b7db23a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/js/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b7db23a

Please sign in to comment.