diff --git a/src/socket/sockethost.js b/src/socket/sockethost.js index ef625eb..51fb095 100644 --- a/src/socket/sockethost.js +++ b/src/socket/sockethost.js @@ -266,6 +266,11 @@ export class SocketHost { async setDevicesState(state, online, connectedAt) { logger.info('Setting devices state to', state, 'and online to', online); + if (!this.host._id) { + logger.warn('Host not found. Skipping device state update.'); + return; + } + const documentPrinters = await listObjects({ model: getModelByName('documentPrinter'), filter: { host: this.host._id }