Skip to content

Commit 47a845e

Browse files
Copilotcaptainsafia
andcommitted
Make StepToResourceMap nullable to address PR #12293 feedback
Co-authored-by: captainsafia <[email protected]>
1 parent 98100dc commit 47a845e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Aspire.Hosting/Pipelines/PipelineConfigurationContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class PipelineConfigurationContext
2727
/// </summary>
2828
public required DistributedApplicationModel Model { get; init; }
2929

30-
internal IReadOnlyDictionary<PipelineStep, IResource> StepToResourceMap { get; init; } = null!;
30+
internal IReadOnlyDictionary<PipelineStep, IResource>? StepToResourceMap { get; init; }
3131

3232
/// <summary>
3333
/// Gets all pipeline steps with the specified tag.
@@ -48,7 +48,7 @@ public IEnumerable<PipelineStep> GetSteps(string tag)
4848
public IEnumerable<PipelineStep> GetSteps(IResource resource)
4949
{
5050
ArgumentNullException.ThrowIfNull(resource);
51-
return StepToResourceMap.Where(kvp => kvp.Value == resource).Select(kvp => kvp.Key);
51+
return StepToResourceMap?.Where(kvp => kvp.Value == resource).Select(kvp => kvp.Key) ?? [];
5252
}
5353

5454
/// <summary>

0 commit comments

Comments
 (0)