Merge pull request #1532 from josStorer/master

Fix the issue where certain remote desktop software may generate drivers with unknown device types, causing null values in the values obtained by GetGPUNames, which leads to program crash during startup
This commit is contained in:
ema
2025-02-05 15:30:32 +08:00
committed by GitHub

View File

@@ -33,7 +33,8 @@ internal static class WMI
List<string> names = [];
foreach (var obj in searcher.Get())
names.Add(obj["Name"] as string);
if (obj["Name"] is string name)
names.Add(name);
return names;
}
@@ -49,6 +50,7 @@ internal static class WMI
{
Debug.WriteLine($"General exception caught: {e.Message}");
}
return [];
}
}
}