From fcf487698537895b88f7e7bcaad4473544468e3c Mon Sep 17 00:00:00 2001 From: Paul Werelds Date: Mon, 18 Oct 2010 07:18:14 +0000 Subject: [PATCH] Fixed the NullReference Exception --- WMI/Hardware.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WMI/Hardware.cs b/WMI/Hardware.cs index ded6c75..572bf4d 100644 --- a/WMI/Hardware.cs +++ b/WMI/Hardware.cs @@ -54,7 +54,9 @@ namespace OpenHardwareMonitor.WMI { Name = hardware.Name; Identifier = hardware.Identifier.ToString(); HardwareType = hardware.HardwareType.ToString(); - Parent = hardware.Parent.Identifier.ToString(); + Parent = (hardware.Parent != null) + ? hardware.Parent.Identifier.ToString() + : ""; } public void Update() { }