Posses actor in controller causes crash

Trying to change controller pawn with Possess method but editor crashes when method executed.

FHitResult TraceResult(ForceInit);
	GetHitResultUnderCursor(ECollisionChannel::ECC_WorldDynamic, false, TraceResult);
	FString TraceString;
	if (TraceResult.GetActor() != nullptr)
		TraceString += FString::Printf(TEXT("Trace Actor %s."), *TraceResult.GetActor()->GetName());

		FString name = TraceResult.GetActor()->GetName();
		if (name.Contains("_WEAPON_PISTOL")) {
			AWeaponActor * weaponActor = Cast<AWeaponActor>(TraceResult.GetActor());
			AGameCharacter * gameCharacter = Cast<AGameCharacter>(GetPawn());

			weaponActor->AttachRootComponentTo(gameCharacter->GetMesh(), FName(TEXT("SocketPistol")), EAttachLocation::SnapToTarget); // Attach the root component of our Weapon actor to the ArmMesh at the location of the socket
		if (name.Contains("_CHARACTER_PLAYER")) {
			ClientMessage("Character selected");
	if (TraceResult.GetComponent() != nullptr)
		TraceString += FString::Printf(TEXT("Trace Comp %s."), *TraceResult.GetComponent()->GetName());

I can only assume that Cast(TraceResult.GetActor()) is NULL for some reason. Can you show the crash log?