Differences between GetOwner()->GetName() and *GetNameSafe(GetOwner())

I just want to know the difference between this two methods and where you should use them

GetOwner() may return nullptr, and if you dereference a nullptr you get a segmentation fault exception.
GetNameSafe checks if the pointer to the object passed is nullptr and if it is, returns the FString “None” rather than crashing your program.

1 Like

Privacy & Terms