GEngine, Player Controller - CRASH

I tried get PlayerController but its CRASH.
Please help me!

APlayerController* pc = GEngine->GetWorld()->GetFirstPlayerController();

I investigate this, and found GEngine->GetWorld() return NULL !!!

How to get Real Pointer from GetWorld() ??

Always check your pointers, so it should look like that:

if(GetWorld() != nullptr ) {
     APlayerController* pc = GetWorld()->GetFirstPlayerController();
}

Also, don’t duplicate questions: