From d5c6c173031eaf2fb52fd257a580e433d546bf64 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 30 Apr 2021 11:56:03 +0200 Subject: [PATCH] Handle error when restarting and frmIndex was open --- Global_Indexer/frmStart.vb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index f7d7a54..098f889 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -430,15 +430,21 @@ Public Class frmStart frmConfig_Basic.ShowDialog() 'Wurde die Sprache in der Konfiguration geƤndert If LANGUAGE_CHANGED = True Then - If USER_LANGUAGE = "de-DE" Then - MsgBox("Zur letzendlichen Neukonfiguration der Sprache ist ein Neustart notwendig!", MsgBoxStyle.Information) - Else - MsgBox("For the final changing of language, a restart is required!", MsgBoxStyle.Information) - End If - Application.Restart() + Try + If USER_LANGUAGE = "de-DE" Then + MsgBox("Zur letzendlichen Neukonfiguration der Sprache ist ein Neustart notwendig!", MsgBoxStyle.Information, Text) + Else + MsgBox("For the final changing of language, a restart is required!", MsgBoxStyle.Information, Text) + End If + Application.Restart() + Catch ex As Exception + LOGGER.Error(ex) + MsgBox("Please restart the application manually.", MsgBoxStyle.Information, Text) + End Try + Else + Start_Folderwatch() + Me.TopMost = True End If - Start_Folderwatch() - Me.TopMost = True End Sub Private Sub TimerFolderWatch_Tick(sender As Object, e As EventArgs) Handles TimerFolderWatch.Tick