From f54b4e67d125385dd67a1dddd98ba09418307c3d Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 14 Oct 2025 08:43:39 +0200 Subject: [PATCH] handle undefined case --- shared/src/helper/BinaryData.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/src/helper/BinaryData.ts b/shared/src/helper/BinaryData.ts index afffd5bfb..d4af1142b 100644 --- a/shared/src/helper/BinaryData.ts +++ b/shared/src/helper/BinaryData.ts @@ -30,8 +30,11 @@ export class BinaryData { } else if (Buffer.isBuffer(input)) { this.buf = input this.hex = input.toString('hex') + } else if (input === undefined) { + this.buf = Buffer.from('') + this.hex = '' } else { - throw new Error('Either valid hex string or Buffer expected') + throw new Error(`Either valid hex string or Buffer expected: ${input}`) } }