Skip to content

Commit

Permalink
fix how numbers are parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-coding committed May 17, 2024
1 parent d03a0b1 commit 46f07e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ExperimentConfigSidecar/Services/ConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void UpdateArtificialMemoryUsage(Dictionary<string, JsonElement> config)
{
if (config.TryGetValue(ConfigPropertyDefinitions.MemoryUsageKey, out JsonElement value))
{
artificialMemoryUsage = value.TryGetInt64(out var leak) ? leak : 0;
artificialMemoryUsage = (value.ValueKind == JsonValueKind.Number && value.TryGetInt64(out var leak)) ? leak : 0;
}
memoryUsageService.UpdateMemoryUsage(artificialMemoryUsage);
}
Expand Down

0 comments on commit 46f07e3

Please sign in to comment.