Check if the platform's ini name is valid (not empty) before trying to load the target platform module.

If the platform's ini name is empty and it drops down to using [IniName]+TargetPlatform it will try to recursively load TargetPlatform.
This can happen in cases where the AllDesktopTargetPlatform module is not available.

#rb david.harvey
#jira UE-86383
#lockdown nick.penwarden

#ROBOMERGE-SOURCE: CL 10928127 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v626-10872990)

[CL 10928128 by anthony bills in Main branch]
This commit is contained in:
anthony bills
2020-01-09 12:05:33 -05:00
parent cb2ede8d41
commit 2e863277c1
@@ -694,6 +694,7 @@ protected:
// that returns multiple TargetPlatforms. we try single first, then full platform
FName FullPlatformModuleName = *(PlatInfo.IniPlatformName + TEXT("TargetPlatform"));
FName SingleTargetPlatformModuleName = *(PlatInfo.TargetPlatformName.ToString() + TEXT("TargetPlatform"));
bool bFullPlatformModuleNameIsValid = !PlatInfo.IniPlatformName.IsEmpty();
ITargetPlatformModule* Module = nullptr;
@@ -701,7 +702,7 @@ protected:
{
Module = FModuleManager::LoadModulePtr<ITargetPlatformModule>(SingleTargetPlatformModuleName);
}
else if (FModuleManager::Get().ModuleExists(*FullPlatformModuleName.ToString()))
else if (bFullPlatformModuleNameIsValid && FModuleManager::Get().ModuleExists(*FullPlatformModuleName.ToString()))
{
Module = FModuleManager::LoadModulePtr<ITargetPlatformModule>(FullPlatformModuleName);
}