Wrap stream.getfeature in try/catch (#1113)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using HidSharp;
|
||||
|
||||
namespace LibreHardwareMonitor.Hardware.Controller.AquaComputer;
|
||||
@@ -119,8 +120,16 @@ internal sealed class AquastreamXT : Hardware
|
||||
//TODO: Check tested and fix unknown variables
|
||||
public override void Update()
|
||||
{
|
||||
_rawData[0] = 0x4;
|
||||
_stream.GetFeature(_rawData);
|
||||
try
|
||||
{
|
||||
_rawData[0] = 0x4;
|
||||
_stream.GetFeature(_rawData);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (_rawData[0] != 0x4)
|
||||
return;
|
||||
@@ -156,4 +165,4 @@ internal sealed class AquastreamXT : Hardware
|
||||
MODE_FAN_AMP = 2,
|
||||
MODE_FAN_CONTROLLER = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user