Unreal Crashes whenever I call UPlayerInput::InputMotion(const FVector&, const FVector&, const FVector&, const FVector&)

I am trying to get the accelerometer accelerations from an android phone as a vector.
I after some searching I found the InputMotion function.

// Called every frame
void AMyClass::Tick(float DeltaTime)

	FVector InTilt;
	FVector InRotationRatel;
	FVector InGravity;
	FVector InAcceleration;

	UPlayerInput* input = PlayerController->PlayerInput;
	input->InputMotion(InTilt, InRotationRatel, InGravity, InAcceleration);

But Unreal crashes instantly upon play:

It is for sure when I call the InputMotion function because if I comment it out nothing happens.

Does anyone know of a way to fix this?

Make sure that UPlayerInput is valid