Right way to spawn niagara system in multiplayer? (I'm looking for a condition to filter in replication)

I have realized that the function ( UNiagaraFunctionLibrary::SpawnSystemAtLocation) returns nullptr in a given context in multiplayer.

Case 1:
When the player is the host it is executed only once and returns a valid pointer.

HasAuthority() = true
GetNetMode() =  ENetMode:ENetMode::NM_ListenServer

Case 2:
When the player is the client, the function is executed twice, one returning a valid pointer and another a null pointer.

//Return a null pointer if
HasAuthority() = true
GetNetMode() =  ENetMode:ENetMode::NM_ListenServer
//Return a valid pointer if
HasAuthority() = false
GetNetMode() =  ENetMode:ENetMode::NM_Client

I’m looking for a condition to not execute the function in the case that it returns the null pointer.
Simply because it’s a waste to run that code (It is not useful).

The system is generated by an actor who is not a pawn (has not controller).
Then I can’t use the function (IsLocallyControlled())…

Is there any condition that helps me filter out useless executions?
Thank you so much!!

Hi
Where are you calling the particle system in the actor? Can you show the function that is responsible for triggering it?

Is the particle system critical information or is it just an effect?

This seem to be the condition i was looking for…

bool Condition = !((Actor->GetLocalRole() != ENetRole::ROLE_SimulatedProxy) && Actor->HasAuthority());

Now seem i can avoid the niagara null pointers

Thank you @3dRaven