We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9892998 commit 6b123deCopy full SHA for 6b123de
src/CLR/Core/TypeSystem.cpp
@@ -2546,6 +2546,16 @@ HRESULT CLR_RT_TypeDescriptor::InitializeFromObject(const CLR_RT_HeapBlock &ref)
2546
{
2547
obj = (CLR_RT_HeapBlock *)array->GetElement(obj->ArrayIndex());
2548
2549
+ // For reference arrays, if the element is null, we need to get the type from the array's element
2550
+ // type rather than trying to dereference a null object
2551
+ if (obj->Dereference() == NULL)
2552
+ {
2553
+ // Use the array's element type information
2554
+ reflex = &array->ReflectionDataConst();
2555
+ cls = &reflex->data.type;
2556
+ break;
2557
+ }
2558
+
2559
NANOCLR_SET_AND_LEAVE(InitializeFromObject(*obj));
2560
}
2561
0 commit comments