Bug removing array of properties

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 *

Hey -

Could you provide the steps that reproduce the crash? I tried creating an Actor class and adding a UPROPERTY array to it, however I do not get a crash when I remove/add elements to the array in a blueprint/blueprint instance/ or class instance in the viewport. Also, please include the callstack and log files from the crash for additional information.

You need to save. It crashes when clicking the save button before clicking the compile button.
But it is not occurring every time.

Attempting to save the blueprint did not cause a crash either. If this crash is still occurring for you, please include the exact setup and steps that lead to the crash. Also provide the callstack and log files from the crash for additional information.

Ok. I’ll do it if it occurs. I’m working on something else now.
Txs.
D.

Hey -

I still have not come across the crash you mentioned in your original post. For the time being I will be marking this post as resolved for tracking purposes. If this crash does occur for you again, feel free to add a comment to reopen the post and we will investigate further. For additional information, please include the full callstack and log files from the crash as well as detailed reproduction steps.

Cheers