Skip to content

Commit

Permalink
review comment: tryparse
Browse files Browse the repository at this point in the history
  • Loading branch information
nijmra committed Jan 16, 2025
1 parent a9ec252 commit 5683b28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kiss.Bff/Intern/Environment/EnvironmentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public IActionResult GetUseKlantIneracties()
[HttpGet("use-vacs")]
public IActionResult GetUseVacs()
{
var useVacs = _configuration["USE_VACS"] ?? "false";
return Ok(new { useVacs = bool.Parse(useVacs) });
return bool.TryParse(_configuration["USE_VACS"] ?? "false", out var useVacs) ?
(IActionResult) Ok(new { useVacs }) : Ok(new { useVacs = false });
}

[HttpGet("versienummer")]
Expand Down

0 comments on commit 5683b28

Please sign in to comment.