Why is GetAIController return null?

I want to run a behavior tree for my pawn. But I got this error: “Accessed None trying to read property CallFunc_GetAIController_ReturnValue”

Fixed by running the behavior tree only in the server.