Invalid object referenced by the PersistentFrame

Hi,

I had this error:

Invalid object referenced by the PersistentFrame: 0x0000001600000000 (Blueprint object: MessageMngr_Game_C /Engine/Transient.ZB4UnrealEdEngine_0:ZB4GameInstance_1.MainUI_C_0.WidgetTree_146.MessageMngr_Game, 
ReferencingProperty: ObjectProperty /Script/ZB4Game.MessageData:TextStyle) - If you have a reliable repro for this, please contact the development team with it.

I was able to identify the root cause. I had a USlateWidgetStyleAsset* property in a USTRUCT that was not intialized to nullptr in the struc constructor.
Settings this property to nullptr solved the issue.

I hope this will help you to track the root cause in the engine and I opened this report as per the comment from the engine.

Hey -

Can you explain how you’re using your USlateWidgetStyleAsset property? I created a struct with a pointer of that type and was able to compile successfully and I did not get a crash on PIE. Please provide the exact steps used to help me reproduce the issue locally.

In my game, I’m using this struc as a parameter of a Blueprint Event.

Try to create a BlueprintImplementableEvent with the FSTruct in parameter
with your struc defined with USTRUCT(BlueprintType).

Hope this helps.

Here is the setup I tried and was still unable to produce the error you’re seeing:

USTRUCT(BlueprintType)
struct FMyStruct
{
	GENERATED_USTRUCT_BODY()
		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
		float MyFloatVar;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
		bool MyBooleanVar;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
		class USlateWidgetStyleAsset* SomeWidgetStyle;
};

Inside class declaration:

UFUNCTION(BlueprintImplementableEvent, Category = Test)
	void MyTestFunc(FMyStruct StructParam);

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
	FMyStruct StructRef;

I call MyTestFunc on BeignPlay and inside my blueprint attempt to print the display name of the USlateWidgetStyleAsset variable. Nothing is printed since it has not been set however I do not receive an error and am able to continue playing in PIE. Can you provide the full code for your struct as well as the blueprint setup where the struct is used as a parameter? If you’re able to reproduce this in a new project, please provide the full reproduction steps to help me investigate the issue on my end.

Hey -

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Hi, I realize this is a very old thread, but I hit this recently as well.

In my case, it was not consistently reproducible, but did occur occasionally after many many calls to my BlueprintImplementableEvent function. This makes me think it could be a threading issue. Also, it seems the serialize function where this error occurs is running in a asynchronous task.

The function I made was in an interface that was implemented by a blueprint class. Also, the function took a const ref, rather than copying the struct.

Ex:

UFUNCTION(BlueprintImplementableEvent, Category = Test)
void MyTestFunc(const FMyStruct& StructParam);

My struct had a couple UPrimitiveComponent pointers. If I didn’t explicitly initialize them to nullptr, I’d hit the issue. It seems to have gone away after I did explicitly initialize them to nullptr in the struct definition.

Maybe there’s some C++ temporary being created from a function call inside the generated binding code, and that is not being properly synced with the threaded task?

2 Likes