diff -r 1c301069cfce -r a2793a38aac0 GUI/SensorNotifyIcon.cs --- a/GUI/SensorNotifyIcon.cs Sun May 15 15:37:50 2011 +0000 +++ b/GUI/SensorNotifyIcon.cs Sun May 15 16:00:22 2011 +0000 @@ -176,6 +176,9 @@ } private string GetString() { + if (!sensor.Value.HasValue) + return "-"; + switch (sensor.SensorType) { case SensorType.Voltage: return string.Format("{0:F11}", sensor.Value); @@ -237,7 +240,8 @@ graphics.Clear(Color.Black); } graphics.FillRectangle(darkBrush, 0.5f, -0.5f, bitmap.Width - 2, bitmap.Height); - float y = 0.16f * (100 - sensor.Value.Value); + float value = sensor.Value.GetValueOrDefault(); + float y = 0.16f * (100 - value); graphics.FillRectangle(brush, 0.5f, -0.5f + y, bitmap.Width - 2, bitmap.Height - y); graphics.DrawRectangle(pen, 1, 0, bitmap.Width - 3, bitmap.Height - 1);