Trying to use UAT to build a plugin that has CanBeUsedWithUnrealHeaderTool set to true will fail due to a null reference exception (log from Main CL 4666322 attached). This happens because the plugin contains "UnrealHeaderTool" in the Supported Programs list. This results in a call to CompilePluginWithUBT() where the first parameter (FileReference HostProjectFile) is passed as null. CompilePluginWithUBT() does not check to make sure this parameter is valid before attempting to access the HostProjectFile.Directory member.

Yes. Prior to 4.21, the structure of the CompilePluginWithUBT() function was different so that it appeared to simply result in an empty string being set when the HostProjectFile parameter is null instead of failing the Build Plugin process. However, the Build Plugin process still failed with a different error.

Steps to Reproduce
  1. Open a command prompt window.
  2. Run the following command:
    • RunUAT.bat BuildPlugin -Plugin="Path\to\ScriptPlugin.uplugin" -Package="Path\to\destination\folder" -compile

The Build Plugin process fails with the following error: ERROR: System.NullReferenceException: Object reference not set to an instance of an object.

The Build Plugin process completes successfully

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-67712 in the post.

Login to Vote

ComponentUE - Foundation - Cpp Tools
Affects Versions4.21.14.22
Target Fix4.22
Fix Commit4678471
Main Commit4718806
Release Commit4862694
CreatedDec 18, 2018
ResolvedJan 3, 2019
UpdatedFeb 12, 2019