Add soft check for null managed object value for unboxing

This commit is contained in:
Wojtek Figat
2023-11-14 11:23:15 +01:00
parent e0de6744e2
commit 3320c76e14

View File

@@ -64,8 +64,8 @@ struct MConverter<T, typename TEnableIf<TAnd<TIsPODType<T>, TNot<TIsBaseOf<class
void Unbox(T& result, MObject* data)
{
CHECK(data);
Platform::MemoryCopy(&result, MCore::Object::Unbox(data), sizeof(T));
if (data)
Platform::MemoryCopy(&result, MCore::Object::Unbox(data), sizeof(T));
}
void ToManagedArray(MArray* result, const Span<T>& data)