PlayerController cause break in code when stopping the game

Hi everyone,

I’m an HUD components library but i’m running in a problem with components using the “FTickableGameObject” class along with the PlayerController.
The game breaks (with a 30% chance) when hitting the “STOP” button in the editor.

The break is generated in the Tick event and reports:

"Unhandled exception at 0x000007FEE6C4E2E8 (UE4Editor-CoreUObject.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

The code generating the break is the following:

if (!(HUDPlayerController))
	return; //trying to skip the break
if (HUDPlayerController->IsPendingKillPending()||HUDPlayerController->IsPendingKill())
	return;//trying to skip the break
float mouseX = 0; float mouseY = 0;	
UHUDCComponent::HUDPlayerController->GetMousePosition(mouseX, mouseY);
//this line generates the break
bool currentMouseState = UHUDCComponent::HUDPlayerController->IsInputKeyDown(EKeys::LeftMouseButton);

I can imagine that it’s something related to the PlayerController being disposed before the tick event stops but i tried checking the “IsPendingKill” value for that reason with no luck.
Any ideas on how i can solve this?

Thanks in advance.