From 0e12ef5f44155dd1a306cc4b54e20a8f9c3b4a34 Mon Sep 17 00:00:00 2001
From: "harald.martini@student.tugraz.at" <harald.martini@student.tugraz.at>
Date: Wed, 28 Jul 2021 15:24:16 +0200
Subject: [PATCH] updated JSONInputDataV10_PrimaryAndStageInputBus

---
 .../InputData/FileIO/JSON/JSONInputData.cs    | 20 ++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs
index 125872e054..6e60303119 100644
--- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs
@@ -1128,18 +1128,24 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
 	{
 		private readonly IXMLInputDataReader _xmlInputReader;
 		private string _primaryVehicleInputDataPath;
-		private IVehicleDeclarationInputData _primaryVehicleInputData;
-		public IVehicleDeclarationInputData PrimaryVehicle =>
-			_primaryVehicleInputData ?? (_primaryVehicleInputData =
-				_xmlInputReader.CreateDeclaration(_primaryVehicleInputDataPath).JobInputData.Vehicle);
 
 		private string _stageInputDataPath;
 		private IVehicleDeclarationInputData _stageInputData;
 
 
-		public IVehicleDeclarationInputData StageInputData => 
-			_stageInputData ?? (_stageInputData =
-				_xmlInputReader.CreateDeclaration(_stageInputDataPath).JobInputData.Vehicle);
+		private IDeclarationInputDataProvider _primaryVehicle;
+
+		public IDeclarationInputDataProvider PrimaryVehicle => 
+			_primaryVehicle ?? (_primaryVehicle =
+				_xmlInputReader.CreateDeclaration(_primaryVehicleInputDataPath));
+
+        public IVehicleDeclarationInputData StageInputData => 
+			_stageInputDataPath != null 
+			?
+            _stageInputData ?? (_stageInputData =
+                _xmlInputReader.CreateDeclaration(_stageInputDataPath).JobInputData.Vehicle)
+			:
+			null;
 
 		private bool? _completed;
 
-- 
GitLab