Update LibreHardwareMonitor
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 3m10s

- Some nullability updates
This commit is contained in:
2026-02-27 13:46:06 -05:00
parent 4cd7e74923
commit afa7bd987a
11 changed files with 58 additions and 38 deletions

View File

@@ -6,15 +6,16 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Serilog;
namespace HardwareMonitorStatusWindow.StatusWindow;
internal static class Data
{
private static PipeClient<IHardwareMonitorService> _pipeClient;
private static IEnumerable<Hardware> _hardware;
private static PipeClient<IHardwareMonitorService>? _pipeClient;
private static IEnumerable<Hardware>? _hardware;
internal static ObservableCollection<SensorEntry> SensorEntries { get; set; }
internal static ObservableCollection<SensorEntry> SensorEntries { get; set; } = [];
internal static async Task LoadComputer()
{
@@ -25,7 +26,7 @@ internal static class Data
}
catch (Exception exception)
{
Log.Error(exception, "");
}
}
@@ -36,14 +37,14 @@ internal static class Data
internal static void CloseComputer()
{
_pipeClient.Dispose();
_pipeClient?.Dispose();
}
internal static IList<Hardware> ComputerHardware => _hardware.ToList();
internal static IList<Hardware> ComputerHardware => _hardware?.ToList() ?? [];
internal static void Load()
{
SensorEntries = JsonSerializer.Deserialize<ObservableCollection<SensorEntry>>(Settings.Default.Sensors);
SensorEntries = JsonSerializer.Deserialize<ObservableCollection<SensorEntry>>(Settings.Default.Sensors) ?? [];
}
internal static void Save()