From 0a87106c80df25b699d407825d8adb9663f59f17 Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Mon, 27 Sep 2021 15:31:35 +0200
Subject: [PATCH] DefaultDriverStrategy reverted some checks for null

---
 .../SimulationComponent/Impl/DefaultDriverStrategy.cs       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
index 2496317005..51e8fea4cc 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
@@ -711,9 +711,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 				? Driver.DataBus.EngineInfo.EngineDragPower(Driver.DataBus.EngineInfo.EngineSpeed)
 				: 0.SI<Watt>();
 
-			var emDragLoss = CalculateElectricMotorDragLoss();
-			var gearboxLoss = Driver.DataBus.GearboxInfo.GearboxLoss();
-			var axleLoss = Driver.DataBus.AxlegearInfo.AxlegearLoss();
+			var emDragLoss = CalculateElectricMotorDragLoss() ?? 0.SI<Watt>();
+			var gearboxLoss = Driver.DataBus.GearboxInfo?.GearboxLoss() ?? 0.SI<Watt>();
+			var axleLoss = Driver.DataBus.AxlegearInfo?.AxlegearLoss() ?? 0.SI<Watt>();
 
 			var coastingResistanceForce = airDragForce + rollResistanceForce
 				+ (gearboxLoss + axleLoss + emDragLoss - engineDragLoss) / vehicleSpeed;
-- 
GitLab