Why i have error the spawn actor?

i try spawn from GameInstance.

GameInstance cpp:

UMyGameInstance::UMyGameInstance()

{
	
	static ConstructorHelpers::FClassFinder<AGameObject> Character(TEXT("/Game/Blueprints/Game/BP_Object"));
	if (Character.Class != NULL)
	{
		GameObject = Character.Class;
	}
}

void UMyGameInstance::SpawnObjectsFromArray()

{

UWorld* const World = GetWorld();

	if (World)
	{
		const FVector& Location = FVector(0.0f, 0.0f, 148.0f);
		const FRotator& Rotation = FRotator();
		FActorSpawnParameters SpawnParams;

		World->SpawnActor<AActor>(GameObject, Location, Rotation, SpawnParams);

	}
}

GameInstance h:

public:

	TSubclassOf<class AGameObject> GameObject;

After launch the game i have error window.

Try checking for Null and switch from AActor to AGameObject as template

if(GameObject->GetClass())
World->SpawnActor<AGameObject>(GameObject->GetClass(), Location, Rotation, SpawnParams);

Also set the Rotator to FRotator::ZeroRotator instead of leaveing it Unitialized. You also dont need the “&” on your FVector and FRotator.

I dont See anything else that can cause trouble.