Catch corrupt or empty config
This commit is contained in:
parent
316f6e68a3
commit
548e8db47f
@ -116,14 +116,16 @@ Module ModuleMySettings
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetTablefromXML(ConfigPath As String)
|
||||
Private Function GetTablefromXML(ConfigPath As String) As DataTable
|
||||
Try
|
||||
Dim oDataset As New DataSet
|
||||
oDataset.ReadXml(ConfigPath)
|
||||
Return oDataset.Tables(0)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in GetTablefromXML" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return Nothing
|
||||
Dim oDataTable = CreateConfigTable()
|
||||
oDataTable.WriteXml(GetUserConfigPath())
|
||||
MsgBox("Fehler beim Laden der Konfiguration. Es wurde die Standard Konfiguration geladen. Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return oDataTable
|
||||
End Try
|
||||
End Function
|
||||
Private Function CreateConfigTable() As DataTable
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user