Added a null check condition.

This commit is contained in:
atef 2024-08-05 08:49:02 +02:00
parent 2b4d484bdc
commit 4e17ce2420
1 changed files with 5 additions and 3 deletions

View File

@ -828,8 +828,10 @@ internal static class Program
private static void ApplyConfigFile(this StatusRecord status, Configuration? config)
{
status.Config.MinSoc = config.MinimumSoC;
status.Config.GridSetPoint = config.GridSetPoint * 1000; // converted from kW to W
if (config == null) return;
status.Config.MinSoc = config.MinimumSoC;
status.Config.GridSetPoint = config.GridSetPoint * 1000; // converted from kW to W
status.Config.ForceCalibrationChargeState = config.CalibrationChargeState;
if (config.CalibrationChargeState == CalibrationChargeType.RepetitivelyEvery)