BuildCookRun.Automation.cs crashes when project file is missing (fix included)

Hi,

BuildCookRun.Automation.cs crashes in some cases when the project file is missing.

The code normally will set the private variable ProjectFullPath but one code path it can fail to do so which causes a crash before even throwing the “Could not find a project file {0}” exception.

The fix is fairly simple:
replace these lines (around line 335):

if (!FileExists_NoExceptions(ProjectFullPath.FullName))
{
    throw new AutomationException("Could not find a project file {0}.", ProjectName);
}

with these:

if (GameProj == null || !FileExists_NoExceptions(ProjectFullPath.FullName))
{
    throw new AutomationException("Could not find a project file {0}.", ProjectName);
}

Cheers,

Hi ,

Thank you for pointing this out. Typically if you already have a possible fix for an issue, we suggest that you submit a pull request on GitHub. This provides us with a better way of tracking and evaluating the suggested fix. If you are unable to submit a pull request, or prefer not to, please let me know.