only check if PID linked if PID is sent

This commit is contained in:
Jonathan Barrow 2022-01-28 21:15:54 -05:00
parent 0f5a0f1a42
commit ea2f6b2596

View File

@ -96,11 +96,12 @@ async function NASCMiddleware(request, response, next) {
return util.nascError(response, '102');
}
const linkedPIDs = device.get('linked_pids');
if (pid) {
const linkedPIDs = device.get('linked_pids');
if (!linkedPIDs.includes(pid)) {
console.log('no linked')
return util.nascError(response, '102');
if (!linkedPIDs.includes(pid)) {
return util.nascError(response, '102');
}
}
}