Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the possible nullref on completing failed results #10513

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions src/Build/BackEnd/BuildManager/BuildSubmission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ public override BuildResult Execute()
return BuildResult!;
}

/// <summary>
/// Whether the build has started.
/// </summary>
internal override bool IsStarted
{
get => BuildRequest != null;
// Ignore the set - the submission is started once the BuildRequest is set.
set { }
}

protected internal override BuildResult CreateFailedResult(Exception exception)
{
ErrorUtilities.VerifyThrow(BuildRequest != null,
Expand Down
2 changes: 1 addition & 1 deletion src/Build/BackEnd/BuildManager/BuildSubmissionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected internal BuildSubmissionBase(BuildManager buildManager, int submission
/// <summary>
/// Whether the build has started.
/// </summary>
internal bool IsStarted { get; set; }
internal abstract bool IsStarted { get; set; }

/// <summary>
/// Indicates that all logging events for this submission are complete.
Expand Down
5 changes: 5 additions & 0 deletions src/Build/Graph/GraphBuildSubmission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ protected internal override void CheckResultValidForCompletion(GraphBuildResult
protected internal override GraphBuildResult CreateFailedResult(Exception exception)
=> new(SubmissionId, exception);

/// <summary>
/// Whether the build has started.
/// </summary>
internal override bool IsStarted { get; set; }

// WARNING!: Do not remove the below proxy properties.
// They are required to make the OM forward compatible
// (code built against this OM should run against binaries with previous version of OM).
Expand Down