fix: load customer if lastUsedMachine is unpaired

This commit is contained in:
Rafael Taranto 2025-04-18 10:19:45 +01:00
parent 39aa25b58d
commit fde31be3aa

View file

@ -147,7 +147,7 @@ function getMachineNames (config) {
function getMachineName (machineId) { function getMachineName (machineId) {
const sql = 'SELECT name FROM devices WHERE device_id=$1' const sql = 'SELECT name FROM devices WHERE device_id=$1'
return db.oneOrNone(sql, [machineId]) return db.oneOrNone(sql, [machineId])
.then(it => it.name) .then(it => it?.name)
} }
function getMachine (machineId, config) { function getMachine (machineId, config) {