When, from the Editor, you try to remove an element of an array of UPROPERTY, the editor crash in
void FObjectInitializer::InitPropertiesFromCustomList(const FCustomPropertyListNode* InPropertyList, UStruct* InStruct, uint8* DataPtr, const uint8* DefaultDataPtr)
{
for (const FCustomPropertyListNode* CustomPropertyListNode = InPropertyList; CustomPropertyListNode; CustomPropertyListNode = CustomPropertyListNode->PropertyListNext)
{
uint8* PropertyValue = CustomPropertyListNode->Property->ContainerPtrToValuePtr<uint8>(DataPtr, CustomPropertyListNode->ArrayIndex);
const uint8* DefaultPropertyValue = CustomPropertyListNode->Property->ContainerPtrToValuePtr<uint8>(DefaultDataPtr, CustomPropertyListNode->ArrayIndex);
if (const UStructProperty* StructProperty = Cast<UStructProperty>(CustomPropertyListNode->Property))
{
// This should never be NULL; we should not be recording the StructProperty without at least one sub property, but we'll verify just to be sure.
if (ensure(CustomPropertyListNode->SubPropertyList != nullptr))
{
InitPropertiesFromCustomList(CustomPropertyListNode->SubPropertyList, StructProperty->Struct, PropertyValue, DefaultPropertyValue);
}
}
else if (const UArrayProperty* ArrayProperty = Cast<UArrayProperty>(CustomPropertyListNode->Property))
{
// Note: The sub-property list can be NULL here; in that case only the array size will differ from the default value, but the elements themselves will simply be initialized to defaults.
InitArrayPropertyFromCustomList(ArrayProperty, CustomPropertyListNode->SubPropertyList, PropertyValue, DefaultPropertyValue);
}
else
{
CustomPropertyListNode->Property->CopySingleValue(PropertyValue, DefaultPropertyValue);
}
}
}
Exception in line 2839
uint8* PropertyValue = CustomPropertyListNode->Property->ContainerPtrToValuePtr(DataPtr, CustomPropertyListNode->ArrayIndex);
DataPtr is NULL.
-
CustomPropertyListNode 0x000001ee227dbba0 {Property=0x000001ee5dba9bc0 (Name=0x000001ee5c384220 “AlterationType”) ArrayIndex=…} const FCustomPropertyListNode *
CustomPropertyListNode->ArrayIndex 0 const int -
CustomPropertyListNode->Property 0x000001ee5dba9bc0 (Name=0x000001ee5c384220 “AlterationType”) UProperty * const {UE4Editor-KSGM-Win64-DebugGame.dll!UByteProperty}
-
CustomPropertyListNode->PropertyListNext 0x000001ee227dbb80 {Property=0x000001ee5dba9d00 (Name=0x000001ee35396fd0 “Value”) ArrayIndex=0 SubPropertyList=…} FCustomPropertyListNode * const
-
DataPtr 0x0000000000000000 unsigned char *