mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 21:58:28 +00:00
Fix Failed to call 'Frontend' 'stop' (TypeError: Cannot read properties of null (reading 'clients') error. https://github.com/Koenkk/zigbee2mqtt/issues/16207
This commit is contained in:
@@ -80,11 +80,11 @@ export default class Frontend extends Extension {
|
||||
|
||||
override async stop(): Promise<void> {
|
||||
super.stop();
|
||||
for (const client of this.wss.clients) {
|
||||
this.wss?.clients.forEach((client) => {
|
||||
client.send(stringify({topic: 'bridge/state', payload: 'offline'}));
|
||||
client.terminate();
|
||||
}
|
||||
this.wss.close();
|
||||
});
|
||||
this.wss?.close();
|
||||
return new Promise((cb: () => void) => this.server.close(cb));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user