Make a CHECK_NULL() with one parameter that accepts a reference. If that reference is null, output to log and return. Its usage will look like:
CHECK_NULL(LilyCharacter, LilySceneTransition, "Invalid Lily Player Character on Game Mode");
CHECK_NULL(PlayerCameraManager, LilySceneTransition, "Invalid Player Camera Manager");
... etc.
You can add parameters and have it in a well-used header file… or you could simply define one per cpp file that has class-specific data baked in. That depends on how you want to architect your code.
Its declaration will look something like:
#define CHECK_NULL(myPointer, myLogClass, myMessage) if(myPointer) UE_LOG(myLogClass, Error, TEXT(myMessage), *this->GetFName()->toString()); return
Make sure that’s all one line!
Sorry I didn’t test it (I came across your tweet but didn’t have my PC setup correctly) but yeah. Hope this helps.