From ca7470eedf08285eb6eab3807cf03e9dc962471a Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 30 Sep 2020 00:20:53 +0000 Subject: [PATCH] fix(core): update --- ts/smartsocket.classes.smartsocket.ts | 6 ++++-- ts/smartsocket.classes.socketserver.ts | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ts/smartsocket.classes.smartsocket.ts b/ts/smartsocket.classes.smartsocket.ts index e679953..412da61 100644 --- a/ts/smartsocket.classes.smartsocket.ts +++ b/ts/smartsocket.classes.smartsocket.ts @@ -60,8 +60,10 @@ export class Smartsocket { public async stop() { await plugins.smartdelay.delayFor(1000); this.socketConnections.forEach((socketObjectArg: SocketConnection) => { - logger.log('info', `disconnect socket with >>alias ${socketObjectArg.alias}`); - socketObjectArg.socket.disconnect(); + if (socketObjectArg) { + logger.log('info', `disconnect socket with >>alias ${socketObjectArg.alias}`); + socketObjectArg.socket.disconnect(); + } }); this.socketConnections.wipe(); this.io.close(); diff --git a/ts/smartsocket.classes.socketserver.ts b/ts/smartsocket.classes.socketserver.ts index 7e005a7..81dbfb7 100644 --- a/ts/smartsocket.classes.socketserver.ts +++ b/ts/smartsocket.classes.socketserver.ts @@ -14,7 +14,6 @@ export class SocketServer { private httpServer: pluginsTyped.http.Server | pluginsTyped.https.Server; // wether httpServer is standalone private standaloneServer = false; - private expressServer: any; constructor(smartSocketInstance: Smartsocket) { this.smartsocket = smartSocketInstance;