TObjectPtr::Get

: OBJPTR: There is a risk that the [FObjectPtr](API\Runtime\CoreUObject\UObject\FObjectPtr) is storing a reference to the wrong type.

Choose your operating system:

Windows

macOS

Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectPtr.h

Include

#include "UObject/ObjectPtr.h"

Syntax

T * Get() const

Remarks

: OBJPTR: There is a risk that the FObjectPtr is storing a reference to the wrong type. This could happen if data was serialized at a time when a pointer field was declared to be of type A, but then the declaration changed and the pointer field is now of type B. Upon deserialization of pre-existing data, we'll be holding a reference to the wrong type of object which we'll just send back static_casted as the wrong type. Doing a check or checkSlow here could catch this, but it would be better if the check could happen elsewhere that isn't called as frequently.