diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index 97773891bf372ec2e2b624c1c87fb7c710da4428..9cc9bad6e024fde781c8783fd562738658db3c53 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -119,7 +119,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl public virtual Second AbsTime { get; set; } public IElectricMotorInfo ElectricMotorInfo(PowertrainPosition pos) { - return ElectricMotors[pos]; + return ElectricMotors.ContainsKey(pos) ? ElectricMotors[pos] : null; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index 89310fbb25f95353ad68c171eca9075918187a56..dd112987a45197921d7d47be89f0030c18ded683 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -268,7 +268,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } return retVal; - } + } }