wechaty / puppet-whatsapp

Wechaty Puppet for Whatsapp
https://npmjs.com/package/wechaty-puppet-whatsapp
Apache License 2.0
24 stars 17 forks source link

System crash when logout #365

Closed hcfw007 closed 2 years ago

hcfw007 commented 2 years ago

When logout, puppeteer will be destroied and restarted. In the process, the heartbeat check will continue (as it stops and starts with manager). And when it tries to get whatsapp client, the system will crash.

Solution: wrap manager.heartbeat alive = !!this.getWhatsAppClient().pupBrowser?.isConnected() with try catch.