Skip to content

Commit ea214c4

Browse files
fix: null handling in GArray/GDictionary create() helpers
1 parent a07fcd7 commit ea214c4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/deep-kids-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@godot-js/editor": patch
3+
---
4+
5+
fix: null handling in GArray/GDictionary create() helpers

scripts/jsb.runtime/src/jsb.inject.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function get_helpers(): ProxyHelpers {
4646
return value[ProxyTarget] ?? value;
4747
},
4848
godot_wrap: function (value: any) {
49+
if (typeof value !== "object" || value === null) {
50+
return value;
51+
}
52+
4953
if (Array.isArray(value)) {
5054
return GArray.create<any>(value);
5155
}

0 commit comments

Comments
 (0)