Adjust if

This commit is contained in:
Fred Boniface 2023-06-07 23:37:55 +01:00
parent 108483597b
commit 440527480b

View File

@ -16,7 +16,7 @@ async function init() {
async function get(headcode) { async function get(headcode) {
const apiPath = `train/headcode/today/${headcode}` const apiPath = `train/headcode/today/${headcode}`
data = await getApi(apiPath, auth = true) data = await getApi(apiPath, auth = true)
if (!data || typeof data !== 'number') { if (typeof data == 'number' || !data) {
log('train-detail.get: Status: ' + data, 'ERR') log('train-detail.get: Status: ' + data, 'ERR')
return [] return []
} }