mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-03-17 01:07:43 +08:00
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:
@@ -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 [];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user