GetOwningPlayerController() Multiplayer NULL-Ptr?

Hi guys,
I´m trying to get my HUD working for multiplayer, but for any reason I´m unable to get a reference to the Character to receive the needed information.
The following setup works fine in singleplayer and crashes only for the client and not for the server:

APlayerController *test = GetOwningPlayerController();

Is there any additional thing I have to setup for networking?
Sorry, I´m new to UE4 C++ and not an C++ expert.
Please help me out…

Before using your player controller make sure it’s not being null. And do that whenever you acquire pointer.

Not going deep, networking initialization might perform few re-initializations, which may lead to null pointer.
I’ve had some problems with that in the multiplayer too. As i was sure it would not be a null.

If it’s not the case and you already do that, provide little bit more information, what you’re doing and where.

Thanks for your answer!
I actually did that pointer check before, but with not getting the intended result overall, i removed it. However, your answer did solve the problem I mentioned above.

The problem why the game was not working as intended, was because I did

UPROPERTY(EditAnywhere,Replicated, BlueprintReadWrite, Category = "Inventory")
		TArray<class AItem*>Inventory;

but I didnt know that i have to do

void AFPSCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	// Replicate to everyone
	DOREPLIFETIME(AFPSCharacter, Inventory);
}

However, thanks for your answer!