Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Build/Logging/TerminalLogger/TerminalLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,15 +808,17 @@ private void TargetFinished(object sender, TargetFinishedEventArgs e)
// For cache plugin projects which result in a cache hit, ensure the output path is set
// to the item spec corresponding to the GetTargetPath target upon completion.
var buildEventContext = e.BuildEventContext;
var targetOutputs = e.TargetOutputs;
if (_restoreContext is null
&& buildEventContext is not null
&& targetOutputs is not null
&& _hasUsedCache
&& e.TargetName == "GetTargetPath"
&& _projects.TryGetValue(new ProjectContext(buildEventContext), out TerminalProjectInfo? project))
{
if (project.IsCachePluginProject)
if (project is not null && project.IsCachePluginProject)
{
foreach (ITaskItem output in e.TargetOutputs)
foreach (ITaskItem output in targetOutputs)
{
project.OutputPath = output.ItemSpec.AsMemory();
break;
Expand Down