From 117b18ae23366d6472c2e3d0dcfa2f0ae57a74ec Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 23 Sep 2020 23:35:51 -0500 Subject: [PATCH] [wasm][bindings] Fix an api regression introduced in #42486 (#42658) * Fix an api regression introduced in #42486 * Update src/mono/wasm/runtime/binding_support.js a number it is Co-authored-by: Ankit Jain Co-authored-by: Ankit Jain --- src/mono/wasm/runtime/binding_support.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/wasm/runtime/binding_support.js b/src/mono/wasm/runtime/binding_support.js index 05ac8ef..5d79755 100644 --- a/src/mono/wasm/runtime/binding_support.js +++ b/src/mono/wasm/runtime/binding_support.js @@ -142,6 +142,9 @@ var BindingSupportLib = { }, js_string_to_mono_string: function (string) { + if (string === null || typeof string === "undefined") + return 0; + var buffer = Module._malloc ((string.length + 1) * 2); var buffer16 = (buffer / 2) | 0; for (var i = 0; i < string.length; i++) -- 2.7.4