diff --git a/router/api.js b/router/api.js index 444d980..1d8e13a 100644 --- a/router/api.js +++ b/router/api.js @@ -50,7 +50,7 @@ module.exports = (fastify, opts, done) => { let file = '' const data = JSON.parse(val); const gen_wpt = (name,desc,latlon,icon="Flag") => `0${name}-${desc}${icon}` - const esc_str = (str) => str.replace('"',""").replace("'","'").replace("<","<").replace(">",">").replace("&","&").replace("\n","...") + const esc_str = (str) => (str||"Undefined").replace('"',""").replace("'","'").replace("<","<").replace(">",">").replace("&","&").replace("\n","...") data.main.forEach(a => { file+= gen_wpt(esc_str(a.hotel.name), esc_str(a.hotel.notes), a.hotel.latlon, icon="Hotel"); a.places.restaurants.forEach(b => {