Skip to content

Commit 8754aae

Browse files
committed
Catch vdf errors
1 parent 8ab872f commit 8754aae

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

CompactGUI/Helper.vb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ Module Helper
1818
If Not parentfolder?.Name = "steamapps" Then Return Nothing
1919

2020
For Each fl In parentfolder.EnumerateFiles("*.acf").Where(Function(f) f.Length > 0)
21-
Dim vConv = VdfConvert.Deserialize(File.ReadAllText(fl.FullName))
22-
If vConv.Value.Item("installdir").ToString = workingDir.Name Then
23-
Dim appID = CInt(vConv.Value.Item("appid").ToString)
24-
Dim sName = vConv.Value.Item("name").ToString
25-
Dim sInstallDir = vConv.Value.Item("installdir").ToString
26-
Return (appID, sName, sInstallDir)
27-
'TODO: Maybe add check to see when game was last updated?
28-
End If
21+
Try
22+
Dim vConv = VdfConvert.Deserialize(File.ReadAllText(fl.FullName))
23+
If vConv.Value.Item("installdir").ToString = workingDir.Name Then
24+
Dim appID = CInt(vConv.Value.Item("appid").ToString)
25+
Dim sName = vConv.Value.Item("name").ToString
26+
Dim sInstallDir = vConv.Value.Item("installdir").ToString
27+
Return (appID, sName, sInstallDir)
28+
'TODO: Maybe add check to see when game was last updated?
29+
End If
30+
Catch
31+
Debug.WriteLine($"VDF file unsupported: {fl.FullName}")
32+
End Try
2933
Next
3034

3135
Return Nothing

0 commit comments

Comments
 (0)