mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: TypeError caused by empty chat
This commit is contained in:
@@ -111,6 +111,7 @@ export default class WAConnectionConnector extends WAConnectionValidator {
|
|||||||
let json = await this.registerCallbackOneTime(['response', 'type:chat'])
|
let json = await this.registerCallbackOneTime(['response', 'type:chat'])
|
||||||
if (json[1].duplicate) json = await this.registerCallbackOneTime (['response', 'type:chat'])
|
if (json[1].duplicate) json = await this.registerCallbackOneTime (['response', 'type:chat'])
|
||||||
|
|
||||||
|
if (!json[2]) return
|
||||||
json[2].forEach(([_, chat]: [any, WAChat]) => {
|
json[2].forEach(([_, chat]: [any, WAChat]) => {
|
||||||
chat.count = +chat.count
|
chat.count = +chat.count
|
||||||
chat.messages = []
|
chat.messages = []
|
||||||
|
|||||||
Reference in New Issue
Block a user