From f60bea61d7737ac1a0c11b8c9cbae07bb6b4225a Mon Sep 17 00:00:00 2001 From: Angelo Verlain Date: Mon, 15 Jan 2024 22:04:24 +0200 Subject: [PATCH] TEMPORARY FIX: some functions don't set the length arg For example, `GLib.Bytes.getData`. This needs to be investigated --- src/types/argument/array.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/argument/array.js b/src/types/argument/array.js index 1051114..9c672dd 100644 --- a/src/types/argument/array.js +++ b/src/types/argument/array.js @@ -78,7 +78,8 @@ export function unboxArray(type, array, length = -1) { let buffer; // manually get the length of the array - if (length === -1) { + // TODO: investigate why some methods don't set the size data (it's kept to 0) + if (length === -1 || length === 0n) { let i = 0; while (getArrayElement(pointer, paramTag, i) !== 0) i++;