1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Field static struct FieldInfo set

This commit is contained in:
Brian Fiete 2024-01-14 14:09:24 -05:00
parent d5c336ffab
commit 4d232c95cb

View file

@ -41,7 +41,7 @@ namespace System.Reflection
public Result<void, Error> SetValue(Object obj, Object value)
{
void* dataAddr = ((uint8*)Internal.UnsafeCastToPtr(obj));
if (mTypeInstance.IsStruct)
if ((obj != null) && (mTypeInstance.IsStruct))
{
Type boxedType = obj.[Friend]RawGetType();
bool typeMatched = false;
@ -108,7 +108,7 @@ namespace System.Reflection
public Result<void, Error> SetValue(Object obj, Variant value)
{
void* dataAddr = ((uint8*)Internal.UnsafeCastToPtr(obj));
if (mTypeInstance.IsStruct)
if ((obj != null) && (mTypeInstance.IsStruct))
{
Type boxedType = obj.[Friend]RawGetType();
bool typeMatched = false;