fix undefined bug

This commit is contained in:
Sorunome 2020-03-29 13:11:10 +02:00
parent df18162f39
commit 7a4cc6b3bf
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C

View File

@ -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;