From 69ec8b97b17a8c0b7255ab9e41f50d3078b1f98b Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sun, 6 Dec 2020 19:46:20 +0530 Subject: [PATCH] Update 1.Validation.ts --- src/WAConnection/1.Validation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WAConnection/1.Validation.ts b/src/WAConnection/1.Validation.ts index d119bb2..98f6bb7 100644 --- a/src/WAConnection/1.Validation.ts +++ b/src/WAConnection/1.Validation.ts @@ -49,7 +49,7 @@ export class WAConnection extends Base { else json.push ('takeover') // send login every 10s const sendLoginReq = () => { - if (this.conn?.readyState !== this.conn.OPEN) { + if (!this.conn || this.conn?.readyState !== this.conn.OPEN) { this.logger.warn('Received login timeout req when WS not open, ignoring...') return }