From 88e12ac3397e45296e42ae75b5e38c6b148a61f7 Mon Sep 17 00:00:00 2001 From: Jaco Date: Wed, 23 Aug 2023 11:48:51 +0300 Subject: [PATCH] New instance of fallback --- packages/util/src/u8a/toBuffer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/util/src/u8a/toBuffer.ts b/packages/util/src/u8a/toBuffer.ts index 087ffddae4..7a9eacc2e7 100644 --- a/packages/util/src/u8a/toBuffer.ts +++ b/packages/util/src/u8a/toBuffer.ts @@ -24,5 +24,5 @@ import { hasBuffer } from '../has.js'; export function u8aToBuffer (value?: Uint8Array | null): T { return hasBuffer ? (xglobal.Buffer as unknown as BufferClass).from(value || []) - : (value || new Uint8Array()) as T; + : new Uint8Array(value || []) as T; }