diff --git a/src/WAConnection/1.Validation.ts b/src/WAConnection/1.Validation.ts index 1afdfb9..d119bb2 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?.readyState !== this.conn.OPEN) { this.logger.warn('Received login timeout req when WS not open, ignoring...') return }