From d2ad4e7dfda9a8fa9d769982df9dbc8151796f06 Mon Sep 17 00:00:00 2001
From: Harald Martini <harald.martini@student.tugraz.at>
Date: Thu, 23 Jun 2022 13:21:50 +0200
Subject: [PATCH] fixed null reference errors for exempted vehicles in
 XMLDeclartionReport_0_9

---
 .../VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs
index 12dbf90118..98ebbacb9b 100644
--- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs
+++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs
@@ -36,12 +36,12 @@ namespace TUGraz.VectoCore.OutputData.XML
 		protected override void InstantiateReports(VectoRunData modelData)
 		{
 			var vehicleData = modelData.VehicleData.InputData;
-			var iepc = vehicleData.Components.IEPC != null;
+			var iepc = vehicleData.Components?.IEPC != null;
 			var ihpc =
-				vehicleData.Components.ElectricMachines?.Entries?.Count(e => e.ElectricMachine.IHPCType != "None") > 0;
+				vehicleData.Components?.ElectricMachines?.Entries?.Count(e => e.ElectricMachine.IHPCType != "None") > 0;
 
 			if (modelData.Exempted) {
-				throw new NotImplementedException();
+				PrimaryReport = new XMLExemptedPrimaryBusVehicleReport();
 			}
 			PrimaryReport = new XMLPrimaryBusVehicleReport();
 			
-- 
GitLab