diff --git a/GUI/SensorGadget.cs b/GUI/SensorGadget.cs index f5f0d31..a91c4a8 100644 --- a/GUI/SensorGadget.cs +++ b/GUI/SensorGadget.cs @@ -486,7 +486,7 @@ namespace OpenHardwareMonitor.GUI { if (x.HardwareType != y.HardwareType) return x.HardwareType.CompareTo(y.HardwareType); - return x.Name.CompareTo(y.Name); + return x.Identifier.CompareTo(y.Identifier); } } } diff --git a/Hardware/Identifier.cs b/Hardware/Identifier.cs index 1e95851..07f0029 100644 --- a/Hardware/Identifier.cs +++ b/Hardware/Identifier.cs @@ -101,8 +101,8 @@ namespace OpenHardwareMonitor.Hardware { } public static bool operator ==(Identifier id1, Identifier id2) { - if (id1 == null) - return id2 == null; + if (id1.Equals(null)) + return id2.Equals(null); else return id1.Equals(id2); }