From 99c2cc34fd930d5102270eb9b2931889b9113050 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Mon, 26 Sep 2016 15:54:55 +0200
Subject: [PATCH] fixes in gui

---
 VECTO/GUI/VectoJobForm.vb | 16 +++++++++-------
 VECTO/GUI/VehicleForm.vb  |  3 ++-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb
index 138a18b293..f04c2e0ab9 100644
--- a/VECTO/GUI/VectoJobForm.vb
+++ b/VECTO/GUI/VectoJobForm.vb
@@ -449,13 +449,15 @@ Public Class VectoJobForm
 
 		End If
 
-		Dim sb As ICycleData
-		For Each sb In vectoJob.Cycles
-			Dim lv0 As ListViewItem = New ListViewItem
-			lv0.Text = GetRelativePath(sb.CycleData.Source, Path.GetDirectoryName(Path.GetFullPath(file))) 'sb.Name
-			LvCycles.Items.Add(lv0)
-		Next
-
+		Try
+			Dim sb As ICycleData
+			For Each sb In vectoJob.Cycles
+				Dim lv0 As ListViewItem = New ListViewItem
+				lv0.Text = GetRelativePath(sb.CycleData.Source, Path.GetDirectoryName(Path.GetFullPath(file))) 'sb.Name
+				LvCycles.Items.Add(lv0)
+			Next
+		Catch ex As Exception
+		End Try
 		CbEngOnly.Checked = vectoJob.EngineOnlyMode
 
 		If driver.OverSpeedEcoRoll.Mode = DriverMode.EcoRoll Then
diff --git a/VECTO/GUI/VehicleForm.vb b/VECTO/GUI/VehicleForm.vb
index 91237d27a1..94be7b9c2f 100644
--- a/VECTO/GUI/VehicleForm.vb
+++ b/VECTO/GUI/VehicleForm.vb
@@ -339,6 +339,7 @@ Public Class VehicleForm
 			End Select
 		End If
 
+		_vehFile = file
 		Dim basePath As String = Path.GetDirectoryName(file)
 		CbCat.SelectedValue = vehicle.VehicleCategory
 		CbAxleConfig.SelectedValue = vehicle.AxleConfiguration
@@ -396,7 +397,7 @@ Public Class VehicleForm
 		VehicleFileBrowser.UpdateHistory(file)
 		Text = GetFilenameWithoutPath(file, True)
 		LbStatus.Text = ""
-		_vehFile = file
+
 		Activate()
 
 		_changed = False
-- 
GitLab