Crashes on play when i try to access AActor inside custom node

Hello, i am trying to make a simple custom node that gives me position of an actor. But it crashes instantly when i hit play. It builds and compiles without any problem.I am not really familiar with c++ and unreal engine so i cant be sure this crash is engine bug or my fault. Thanks for the help in advance. here is my .h file:

UCLASS()
class TEST3_API UC_BPNodeTest : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

		UFUNCTION(BlueprintCallable, Category = "Test")
		static FVector GetPos(AActor* actor);
};

inside .cpp file:

    FVector UC_BPNodeTest::GetPos(AActor* actor) {
    	FVector v = actor->GetActorLocation();
    	return v;
    }

in an actor:

Because you are calling this on Tick, GetOwner might not return a valid reference at the start.

You could update your GetPos( ) function to something like:

FVector UC_BPNodeTest::GetPos(AActor *InActor)
{
    if(InActor)
    {
        return InActor->GetActorLocation( );
    }
    return FVector::ZeroVector;
}

Thank you. It worked and it was allways null because i was using get owner on a root object, there was no owner, i changed it with self and it worked.