From 6c57e0e9f2722ddbe6d13f2a987f5db79d413812 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:37:13 +0200 Subject: [PATCH] fix: properly handle wrapper function --- src/me/topchetoeu/jscript/engine/values/Values.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/me/topchetoeu/jscript/engine/values/Values.java b/src/me/topchetoeu/jscript/engine/values/Values.java index b4cc5a4..83646e6 100644 --- a/src/me/topchetoeu/jscript/engine/values/Values.java +++ b/src/me/topchetoeu/jscript/engine/values/Values.java @@ -70,8 +70,7 @@ public class Values { @SuppressWarnings("unchecked") public static T wrapper(Object val, Class clazz) { - if (!isWrapper(val)) return null; - + if (!isWrapper(val)) val = new NativeWrapper(val); var res = (NativeWrapper)val; if (res != null && clazz.isInstance(res.wrapped)) return (T)res.wrapped; else return null;