Fix another Failed to call 'Frontend' 'stop' . https://github.com/Koenkk/zigbee2mqtt/issues/16317

This commit is contained in:
Koen Kanters
2023-01-23 20:21:03 +01:00
parent 06820d2220
commit b89a99fe0c
+4 -1
View File
@@ -85,7 +85,10 @@ export default class Frontend extends Extension {
client.terminate();
});
this.wss?.close();
return new Promise((cb: () => void) => this.server.close(cb));
/* istanbul ignore else */
if (this.server) {
return new Promise((cb: () => void) => this.server.close(cb));
}
}
@bind private onRequest(request: http.IncomingMessage, response: http.ServerResponse): void {