From 26ea7e36d563c1ae1213a87d9816bb49456f04b2 Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Sun, 14 Aug 2022 19:48:53 -0300 Subject: [PATCH] Fix `Variant.Get()` Crash --- BeefLibs/corlib/src/Variant.bf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Variant.bf b/BeefLibs/corlib/src/Variant.bf index 0aed61ad..763c6b16 100644 --- a/BeefLibs/corlib/src/Variant.bf +++ b/BeefLibs/corlib/src/Variant.bf @@ -293,7 +293,7 @@ namespace System obj = (T)Internal.UnsafeCastToObject(*(void**)(void*)mData); else obj = (T)Internal.UnsafeCastToObject((void*)mData); - Debug.Assert(obj.GetType().IsSubtypeOf(type)); + Debug.Assert(obj == null || obj.GetType().IsSubtypeOf(type)); return obj; }