Skip to content

Commit

Permalink
Merge pull request #997 from DFE-Digital/bug/156919-null-reference-wi…
Browse files Browse the repository at this point in the history
…thdrawn

bug fix for withdrawn decision
  • Loading branch information
paullocknimble authored Feb 21, 2024
2 parents a86ed58 + c03cf7d commit 68c5b29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public AdvisoryBoardDecision()
{
DeferredReasons = new List<AdvisoryBoardDeferredReasonDetails>();
DeclinedReasons = new List<AdvisoryBoardDeclinedReasonDetails>();
WithdrawnReasons = new List<AdvisoryBoardWithdrawnReasonDetails>();
}

public int AdvisoryBoardDecisionId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static ProjectStatus MapProjectStatus(string status)
const string yellow = nameof(yellow);
const string orange = nameof(orange);
const string red = nameof(red);
const string purple = nameof(purple);

if (Enum.TryParse(status, out AdvisoryBoardDecisions result))
{
Expand All @@ -73,6 +74,7 @@ public static ProjectStatus MapProjectStatus(string status)
AdvisoryBoardDecisions.Approved => new ProjectStatus(result.ToString().ToUpper(), green),
AdvisoryBoardDecisions.Deferred => new ProjectStatus(result.ToString().ToUpper(), orange),
AdvisoryBoardDecisions.Declined => new ProjectStatus(result.ToString().ToUpper(), red),
AdvisoryBoardDecisions.Withdrawn => new ProjectStatus(result.ToString().ToUpper(), purple),
_ => new ProjectStatus(result.ToString().ToUpper(), yellow)
};
}
Expand Down

0 comments on commit 68c5b29

Please sign in to comment.