]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
check aPlace.class exists before calling its method
authormarc tobias <mtmail@gmx.net>
Thu, 20 Feb 2020 17:05:45 +0000 (18:05 +0100)
committermarc tobias <mtmail@gmx.net>
Thu, 20 Feb 2020 17:05:45 +0000 (18:05 +0100)
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, ' '));