From 7e41566662a296a28357245a604612a1be2da6b5 Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Tue, 12 Apr 2022 15:43:00 +0200
Subject: [PATCH] VectoJobForm: Corrected bug when GearboxInputData is empty
 (e.g. E3)

---
 VECTO/GUI/VectoJobForm.vb | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb
index ee4ab6efbc..0216c7c5ae 100644
--- a/VECTO/GUI/VectoJobForm.vb
+++ b/VECTO/GUI/VectoJobForm.vb
@@ -464,20 +464,24 @@ Public Class VectoJobForm
         UpdateEnabledControls()
         'Files -----------------------------
         TbVEH.Text = GetRelativePath(inputData.JobInputData.Vehicle.DataSource.SourceFile, _basePath)
-        If (JobType <> VectoSimulationJobType.BatteryElectricVehicle) Then
-            TbENG.Text = GetRelativePath(inputData.JobInputData.Vehicle.Components.EngineInputData.DataSource.SourceFile, _basePath)
-        End If
-        If (JobType <> VectoSimulationJobType.BatteryElectricVehicle OrElse not IsNothing(inputData.JobInputData.Vehicle.Components.GearboxInputData)) Then
-            TbGBX.Text = GetRelativePath(inputData.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, _basePath)
-        End If
-        If (inputData.DriverInputData.GearshiftInputData Is Nothing) Then
-            TbShiftStrategyParams.Text = ""
-        Else
-            TbShiftStrategyParams.Text = GetRelativePath(inputData.DriverInputData.GearshiftInputData.Source, _basePath)
-        End If
-        If (JobType = VectoSimulationJobType.ParallelHybridVehicle OrElse JobType = VectoSimulationJobType.SerialHybridVehicle) Then
-            tbHybridStrategyParams.Text = GetRelativePath(inputData.JobInputData.HybridStrategyParameters.Source, _basePath)
-        End If
+		If (JobType <> VectoSimulationJobType.BatteryElectricVehicle) Then
+			TbENG.Text = GetRelativePath(inputData.JobInputData.Vehicle.Components.EngineInputData.DataSource.SourceFile, _basePath)
+		Else
+			TbENG.Text = ""
+		End If
+		If (JobType <> VectoSimulationJobType.BatteryElectricVehicle AndAlso inputData.JobInputData.Vehicle.Components.GearboxInputData IsNot Nothing) Then
+			TbGBX.Text = GetRelativePath(inputData.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, _basePath)
+		Else
+			TbGBX.Text = ""
+		End If
+		If (inputData.DriverInputData.GearshiftInputData Is Nothing) Then
+			TbShiftStrategyParams.Text = ""
+		Else
+			TbShiftStrategyParams.Text = GetRelativePath(inputData.DriverInputData.GearshiftInputData.Source, _basePath)
+		End If
+		If (JobType = VectoSimulationJobType.ParallelHybridVehicle OrElse JobType = VectoSimulationJobType.SerialHybridVehicle) Then
+			tbHybridStrategyParams.Text = GetRelativePath(inputData.JobInputData.HybridStrategyParameters.Source, _basePath)
+		End If
 
         'Start/Stop
         Dim driver As IDriverEngineeringInputData = inputData.DriverInputData
-- 
GitLab