Initializing USphereComponent

I want to add a trigger volume to my C++ Actor, that can be set to a sphere/cube/capsule in the editor. This is how I’m currently doing it:

.h

UPROPERTY(EditAnywhere, BlueprintReadOnly, SimpleDisplay)
UShapeComponent* TriggerVolume;

.cpp (Constructor)

Base = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Base"));
TriggerVolume = CreateAbstractDefaultSubobject<UShapeComponent>(TEXT("Trigger Volume"));
RootComponent = Base;
TriggerVolume->AttachParent = Base;

However, I get a crash on the last line of the .cpp file. Is it because the volume is abstract? How can I properly accomplish what I want?

Error:
Access violation - code c0000005 (first/second chance not available)

Try = RootComponent instead of Base and see if that helps

It didn’t–RootComponent is already the Base anyway, and there would be no point in allowing people to set the AttachParent if it could only be attached to the root component.

This really should’ve been obvious earlier, but it’s because CreateAbstractDefaultSubobject is returning null. Thanks to this question I’ve found out that I should be using CreateDefaultSubobject instead.