From 7a4cc6b3bf2351b2eecb78046c149e788326f887 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sun, 29 Mar 2020 13:11:10 +0200 Subject: [PATCH] fix undefined bug --- src/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index d8418d6..c6a0f1f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -145,7 +145,9 @@ export class Client extends EventEmitter { } public async disconnect() { - await this.api.stopListening(); + if (this.api) { + await this.api.stopListening(); + } if (this.contactsInterval) { clearInterval(this.contactsInterval); this.contactsInterval = null;