]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/handlebar_helpers.js
check aPlace.class exists before calling its method
[nominatim-ui.git] / src / handlebar_helpers.js
index 3ef3a662f3331c9574c7a3f74fd341ab737effc5..088d09cbd8ec62b8cff4a4ecfbff318c46d354d2 100644 (file)
@@ -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, ' '));