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;