Skip to content

Commit 7e68b23

Browse files
author
Chris Jakeman
committed
Change to suit VMWare
1 parent 10c2adb commit 7e68b23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/ORTS.Common/SystemInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static void WriteEnvironment(TextWriter output)
7474
{
7575
foreach (ManagementObject display in new ManagementClass("Win32_VideoController").GetInstances())
7676
{
77-
output.WriteLine("Video = {0} ({1:F1} GB RAM){2}", (string)display["Description"], (float)(uint)display["AdapterRAM"] / 1024 / 1024 / 1024, GetPnPDeviceDrivers(display));
77+
// ? used as display["AdapterRAM"] may be null on a virtual machine (e.g. VMWare)
78+
output.WriteLine("Video = {0} ({1:F1} GB RAM){2}", (string)display["Description"], (float?)(uint?)display["AdapterRAM"] / 1024 / 1024 / 1024, GetPnPDeviceDrivers(display));
7879
}
7980
}
8081
catch (Exception error)

0 commit comments

Comments
 (0)