mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: BufferJSON failing with empty string
This commit is contained in:
@@ -34,7 +34,7 @@ export const BufferJSON = {
|
|||||||
reviver: (_, value: any) => {
|
reviver: (_, value: any) => {
|
||||||
if(typeof value === 'object' && !!value && (value.buffer === true || value.type === 'Buffer')) {
|
if(typeof value === 'object' && !!value && (value.buffer === true || value.type === 'Buffer')) {
|
||||||
const val = value.data || value.value
|
const val = value.data || value.value
|
||||||
return typeof val === 'string' ? Buffer.from(val, 'base64') : Buffer.from(val)
|
return typeof val === 'string' ? Buffer.from(val, 'base64') : Buffer.from(val || [])
|
||||||
}
|
}
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|||||||
Reference in New Issue
Block a user