From: marc tobias Date: Thu, 20 Feb 2020 17:05:45 +0000 (+0100) Subject: check aPlace.class exists before calling its method X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/0a9a8bbaacd932b2fce2f950a14ca3d297bd4dfe?ds=sidebyside check aPlace.class exists before calling its method --- diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index 3ef3a66..088d09c 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -110,7 +110,7 @@ Handlebars.registerHelper({ return s && s[0].toUpperCase() + s.slice(1); } - if (aPlace.type && aPlace.type === 'yes') { + if (aPlace.type && aPlace.type === 'yes' && aPlace.class) { return capitalize(aPlace.class.replace(/_/g, ' ')); } return capitalize(aPlace.type.replace(/_/g, ' '));