Commit 13bb5893 authored by Raphael Das Gupta's avatar Raphael Das Gupta

gracefully handle undefined opening_url

which occurs when creating a new POI without having filled in
the Opening hours URL form field.

Together with the previous commit 38415237,
this should fix #239.
parent 38415237
Pipeline #95978427 passed with stages
in 3 minutes and 23 seconds
......@@ -129,7 +129,9 @@ function createDetailTags(businessPOI) {
if (businessPOI.details.opening_hours.length !== 0) {
text += `<tag k="opening_hours" v="${businessPOI.details.opening_hours}"/>`;
}
if (businessPOI.details.opening_url.length !== 0) {
// TODO: Find out why `opening_url` has to be treated differently
// than the other properties of `businessPOI.details`.
if (businessPOI.details.opening_url) { // if opening_url is neither undefined nor empty
text += `<tag k="opening_hours:url" v="${businessPOI.details.opening_url}"/>`;
}
if (businessPOI.details.phone.length !== 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment