This commit is contained in:
Damien Broqua 2022-06-27 14:39:50 +02:00
parent e0634aeeab
commit ba4063ad40

View file

@ -140,11 +140,11 @@ const getStationName = (start, callback) => {
callback(err);
} else {
const html = htmlparser(body);
const name = html
.querySelector("strong")
.toString()
.replace(/[<>/]/g, "")
.replace(/strong/g, "");
const name = html?
.querySelector("strong")?
.toString()?
.replace(/[<>/]/g, "")?
.replace(/strong/g, "") || null;
if (name) {
item.name = name;