fix: properly handle wrapper function

This commit is contained in:
TopchetoEU 2023-11-28 21:37:13 +02:00
parent f1932914ee
commit 6c57e0e9f2
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -70,8 +70,7 @@ public class Values {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T wrapper(Object val, Class<T> clazz) { public static <T> T wrapper(Object val, Class<T> clazz) {
if (!isWrapper(val)) return null; if (!isWrapper(val)) val = new NativeWrapper(val);
var res = (NativeWrapper)val; var res = (NativeWrapper)val;
if (res != null && clazz.isInstance(res.wrapped)) return (T)res.wrapped; if (res != null && clazz.isInstance(res.wrapped)) return (T)res.wrapped;
else return null; else return null;