Skip to content

Commit f5c7a50

Browse files
committed
Fix by catching all types of exception
1 parent d873500 commit f5c7a50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/Orts.Common/SystemInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static SystemInfo()
6565
Languages = (string[])operatingSystem["MUILanguages"],
6666
};
6767
}
68-
catch (ManagementException error)
68+
catch (Exception error)
6969
{
7070
// Likely to catch multiple exceptions like:
7171
// Exception thrown: 'System.IO.InvalidDataException' in ORTS.Menu.dll
@@ -85,7 +85,7 @@ static SystemInfo()
8585
MaxClockMHz = (uint)processor["MaxClockSpeed"],
8686
}).ToList();
8787
}
88-
catch (ManagementException error)
88+
catch (Exception error)
8989
{
9090
Trace.WriteLine(error);
9191
}
@@ -102,7 +102,7 @@ static SystemInfo()
102102
MemoryMB = (uint)((long)descriptions.FirstOrDefault(desc => desc.Description == (string)adapter["Name"]).DedicatedVideoMemory / 1024 / 1024),
103103
}).ToList();
104104
}
105-
catch (ManagementException error)
105+
catch (Exception error)
106106
{
107107
Trace.WriteLine(error);
108108
}

0 commit comments

Comments
 (0)