From d94ef73bc9059954e1d5ec725828a3f23ba9e31d Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Tue, 8 Nov 2016 14:37:47 +0100
Subject: [PATCH] Report Progress in GUI: check to avoid thread exception

---
 VECTO/GUI/MainForm.vb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/VECTO/GUI/MainForm.vb b/VECTO/GUI/MainForm.vb
index 47f43c18a9..7f84390203 100644
--- a/VECTO/GUI/MainForm.vb
+++ b/VECTO/GUI/MainForm.vb
@@ -287,16 +287,14 @@ Imports VectoAuxiliaries
 
 	' ReSharper disable once UnusedMember.Global -- used via Logging Framework!
 	Public Shared Sub LogMethod(level As String, message As String)
-		Try
+		If VectoWorkerV3.IsBusy AndAlso Not VectoWorkerV3.CancellationPending Then
 			If level = "Warn" Then
 				VectoWorkerV3.ReportProgress(100, New VectoProgress With {.Target = "ListBoxWarning", .Message = message})
 			ElseIf level = "Error" Or level = "Fatal" Then
 				VectoWorkerV3.ReportProgress(100, New VectoProgress With {.Target = "ListBoxError", .Message = message})
 
 			End If
-		Catch e As InvalidOperationException
-
-		End Try
+		End If
 	End Sub
 
 	'Declaration mode GUI settings
-- 
GitLab