Editor crashes when I try to access or modify any properties or variables of MyPlayerController. (C++)

As I said on the title I don’t understand what the problem is. I try to change the variables in MyPlayerController from another class and then the editor crashes. That happened too, for example, if I try MyPlayerController->GetName() from the MyGameMode.cpp.

I have indicated in them where the editor crashes.
Here are my two cpp:

APruebaGameModeBase.cpp, In the lines: 55, 57 and 61.

AMyPlayerController.cpp, In the line: 17.

Begin play isn’t going to be able to get a reference to your PlayerController, so when you try to get a reference, you are actually get a nullptr and then try to use that nullptr in UE_LOG, which causes your game to crash.

This is the function in the GameModeBase class that creates a PlayerController for your game. You can get a reference to it there:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AGameModeBase/Login/1/index.html

Something like:

[MyGameModeBase.h]

UFUNCTION( )
virtual APlayerController * Login(UPlayer * NewPlayer, ENetRole InRemoteRole, const FString & Portal, const FString & Options, const FUniqueNetIdRepl & UniqueId, FString & ErrorMessage) override;

[MyGameModeBase.cpp]

APlayerController * Login(UPlayer * NewPlayer, ENetRole InRemoteRole, const FString & Portal, const FString & Options, const FUniqueNetIdRepl & UniqueId, FString & ErrorMessage) 
{
    AMyPlayerControllerClass *MyPC = Cast<AMyPlayerControllerClass>(Super::Login(NewPlayer, InRemoteRole, Portal, Options, UniqueId, ErrorMessage));
    if(MyPC)
    {
        UE_LOG(LogTemp, Warning, TEXT("My PC! %s"), *MyPC->GetName( ));
    }
}

This generate another problem, when i try CreateWidget, the editor say that the player controller hasn’t a Player.
Anyway, looking your answer I found a reason for my crash: In the UE_LOG I had put *(*MyPC->GetName()), instead of *MyPC->GetName( ). Thank you!