Added a null check condition.
This commit is contained in:
parent
2b4d484bdc
commit
4e17ce2420
|
@ -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)
|
||||
|
@ -839,6 +841,6 @@ internal static class Program
|
|||
else if (config.CalibrationChargeState == CalibrationChargeType.AdditionallyOnce)
|
||||
{
|
||||
status.Config.DayAndTimeForAdditionalCalibration = config.CalibrationChargeDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue