My friend was making a PlayerController class and inside that class’s PlayerTick he put
if(GEngine != nullptr)
{
UGameViewportClient* gameViewport = GEngine->GameViewport;
check(gameViewport != nullptr); // TODO handle lack of gameViewport
//...
}
I wanted to test some functionality, so I created a child blueprint, but then the editor crashed. After a long search I found out that the PlayerTick method was called on BP creation and because the game wasn’t running there was no GameViewport so the check macro was crashing the editor. Is it possible to somehow prevent this behaviour (other than removing the check)?