mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: handle undefined in writeJid
This commit is contained in:
@@ -46,8 +46,8 @@ export const encodeBinaryNode = ({ tag, attrs, content }: BinaryNode, buffer: nu
|
|||||||
const writeJid = ({ agent, device, user, server }: ReturnType<typeof jidDecode>) => {
|
const writeJid = ({ agent, device, user, server }: ReturnType<typeof jidDecode>) => {
|
||||||
if(typeof agent !== 'undefined' || typeof device !== 'undefined') {
|
if(typeof agent !== 'undefined' || typeof device !== 'undefined') {
|
||||||
pushByte(TAGS.AD_JID)
|
pushByte(TAGS.AD_JID)
|
||||||
pushByte(agent)
|
pushByte(agent || 0)
|
||||||
pushByte(device)
|
pushByte(device || 0)
|
||||||
writeString(user)
|
writeString(user)
|
||||||
} else {
|
} else {
|
||||||
pushByte(TAGS.JID_PAIR)
|
pushByte(TAGS.JID_PAIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user