Skip to content

Commit

Permalink
Fix crash on non MSI
Browse files Browse the repository at this point in the history
  • Loading branch information
TekuSP committed Oct 23, 2023
1 parent 5e261fd commit 7ec5b30
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions SubZero/Models/MSIWmiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,58 @@ public MSIWmiHelper()
//Test if they are valid
using (ManagementObjectCollection test = MSI_CPU.Get())
{
IsAvailableMSI_CPU = test.Count != 0;
try
{
IsAvailableMSI_CPU = test.Count != 0;
}
catch
{
IsAvailableMSI_CPU = false;
}
}
using (ManagementObjectCollection test = MSI_GPU.Get())
{
IsAvailableMSI_GPU = test.Count != 0;
try
{
IsAvailableMSI_GPU = test.Count != 0;
}
catch
{
IsAvailableMSI_GPU = false;
}
}
using (ManagementObjectCollection test = MSI_AP.Get())
{
IsAvailableMSI_AP = test.Count != 0;
{
try
{
IsAvailableMSI_AP = test.Count != 0;
}
catch
{
IsAvailableMSI_AP = false;
}
}
using (ManagementObjectCollection test = MSI_LaptopModel.Get())
{
IsAvailableMSI_LaptopModel = test.Count != 0;
try
{
IsAvailableMSI_LaptopModel = test.Count != 0;
}
catch
{
IsAvailableMSI_LaptopModel = false;
}
}
using (ManagementObjectCollection test = MSI_System.Get())
{
IsAvailableMSI_System = test.Count != 0;
try
{
IsAvailableMSI_System = test.Count != 0;
}
catch
{
IsAvailableMSI_System = false;
}
}
}

Expand Down

0 comments on commit 7ec5b30

Please sign in to comment.