Saving data to Blueprint on UObject::PreSave

I’ve written a system which parses the function flow of a number of custom function nodes which are called by a BlueprintImplementableEvent. This data is stored whenever I click on Compile, which I’ve setup to trigger a save on success. This works great and the expected data is stored in the blueprint.

However, the editor crashes whenever I construct an object of the same class as the one I’ve compiled during the same editor session. After a restart of the editor the object is constructed as expected without no issues. But as soon as the object is modified and saved, the same types of crashes related to corrupt/cleared properties occur within: FObjectInitializer::InitPropertiesFromCustomList()

I would prefer not having to restart the editor each time I modify the graph.

##The setup looks like this.

void UMyObject::PreSave(const class ITargetPlatform* TargetPlatform)

The Parse() function simply executes some setup code, and then calls the BlueprintImplementableEvent which in turn calls each connected function, parsing a graph which gets stored in the object.

##Now to the question.
Is there any better (and more stable) preferred way of saving data to the object during save?

Give some more information, what do you get in logs? got to Saved/Logs of you project… prehaps “Assert Failed: bCustomPropertyListForPostConstructionInitialized”?

Sure, the check(ContainerPtr) inside ContainerPtrToValuePtr() fails and cause a crash.

I’ve attached the callstack as well as the whole code snippet where the assert happen.

It’s one of the crashes which I’m having. But they all seem related, it’s always FObjectInitializer::InitPropertiesFromCustomList() being the culprit.

for (const FCustomPropertyListNode* CustomPropertyListNode = InPropertyList; CustomPropertyListNode; CustomPropertyListNode = CustomPropertyListNode->PropertyListNext)
	// Crash here due to DataPtr being nulllptr which makes check(ContainerPtr) inside ContainerPtrToValuePtr fail
	uint8* PropertyValue = CustomPropertyListNode->Property->ContainerPtrToValuePtr<uint8>(DataPtr, CustomPropertyListNode->ArrayIndex);

link text

Update. As of now I’m launching the game as a standalone executable, this is a possible workaround which don’t cause any errors or crashes but if anyone else find any other, better method, let me now.