Fix null access by only computing a log location for UHT if the current application has an Output file (for now? maybe better fix later, but unblocking programs now)

#jira
#rnx
[CODEREVIEW] Ben.Marsh

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 10910611 via CL 10910653 via CL 10910662 via CL 10910669
#ROBOMERGE-BOT: CORE (Main -> Dev-Core) (v626-10872990)

[CL 10923249 by marc audy in Dev-Core branch]
This commit is contained in:
marc audy
2020-01-09 03:11:52 -05:00

View File

@@ -1141,12 +1141,18 @@ namespace UnrealBuildTool
Directory.CreateDirectory(ModuleInfoFileName.Directory.FullName);
System.IO.File.WriteAllText(ModuleInfoFileName.FullName, fastJSON.JSON.Instance.ToJSON(Manifest, new fastJSON.JSONParameters { UseExtensions = false }));
string LogFileName = Log.OutputFile.GetFileName();
LogFileName = (LogFileName.StartsWith("UBT") ? "UHT" + LogFileName.Substring(3) : LogFileName + "_UHT");
LogFileName = FileReference.Combine(Log.OutputFile.Directory, LogFileName).ToString();
string CmdLine = (ProjectFile != null) ? "\"" + ProjectFile.FullName + "\"" : TargetName;
CmdLine += " \"" + ModuleInfoFileName + "\" -LogCmds=\"loginit warning, logexit warning, logdatabase error\" -Unattended -WarningsAsErrors -abslog=\"" + LogFileName + "\"";
CmdLine += " \"" + ModuleInfoFileName + "\" -LogCmds=\"loginit warning, logexit warning, logdatabase error\" -Unattended -WarningsAsErrors";
if (Log.OutputFile != null)
{
string LogFileName = Log.OutputFile.GetFileName();
LogFileName = (LogFileName.StartsWith("UBT") ? "UHT" + LogFileName.Substring(3) : LogFileName + "_UHT");
LogFileName = FileReference.Combine(Log.OutputFile.Directory, LogFileName).ToString();
CmdLine += " -abslog =\"" + LogFileName + "\"";
}
if (UnrealBuildTool.IsEngineInstalled())
{
CmdLine += " -installed";