SetObject generates Access violation

Hi! Really big thanks for asking for the Callstack… I was able to solve the problem while debugging, but only 'cause you asked for Callstack… :smiley: Marked answer as solution!(I never ever used(/had to use) it before).

Hi! I tried to use Details->SetObject(asdfff);
Details is a DetailView pointer, and asdfff is an UObject pointer. asdfff is not null, and I don’t know what can be the problem. The build succeeds. When the SetObject function runs, the editor crashes with access violation.

Details is a nullptr in that case :stuck_out_tongue_winking_eye: not asdfff

Of course the error can come from somewhere else to. Provide the Callstack in that case.

:smiley: Ok, tested, but Details is not null, and the objects are the following:
Details is a TSharedPtr Details;
asdfff in an UPropertyHandler * asdfff;
UpropertyHandler is an uclass:

UCLASS()
class BUILDIT_API UPropertyHandler : public UObject
{
	GENERATED_BODY()
	
public:
	UPROPERTY(Category = "qwert", EditAnywhere)
		int32 testvar;
	
	
};

And here’s all I do with these components:

	FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
	FDetailsViewArgs DetailsViewArgs(false, false, false, FDetailsViewArgs::HideNameArea);
	// Create a new detailspanel
	Details = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
	Details->SetObject(asdfff);
	SAssignNew(ToolkitWidget, SBorder)
		.HAlign(HAlign_Center)
		.Padding(25)
		.IsEnabled_Static(&Locals::IsWidgetEnabled)
		[
			SNew(SVerticalBox)
			+ SVerticalBox::Slot()
			.AutoHeight()
			.HAlign(HAlign_Center)
			.Padding(50)
			[
				SNew(STextBlock)
				.AutoWrapText(true)
				.Text(LOCTEXT("HelperLabel", "look."))
			]
			+ SVerticalBox::Slot()
				.HAlign(HAlign_Center)
				.AutoHeight()
				[
					Details.ToSharedRef()
				]

		];

The access violation crash disappears if I comment the SetObject line.

Thanks for the comment… :slight_smile:

Edit: asdfff is a pointer to 0xcdcdcdcdcd… And the UPROPERTY(s) are returning memory read error… Idk why the pointer is bad. Any idea?

Where does asdfff come from? How did you initialize it? And Callstack please :stuck_out_tongue_winking_eye: