diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs index dc7739b3f9a0d952ed71b77f9befe8cdbbb7ba9c..950d2c8f414317474f9f32968eebba533a137e45 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs @@ -81,7 +81,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl foreach (var kv in _powerDemands.Where(kv => !string.IsNullOrWhiteSpace(kv.Key))) { container[kv.Key] = kv.Value; } - if (container[ModalResultField.P_aux] == null) { + if (container[ModalResultField.P_aux] == null || container[ModalResultField.P_aux] == DBNull.Value) { // don't overwrite if someone else already wrote the total aux power container[ModalResultField.P_aux] = _powerDemands.Values.Sum(p => p); }