Skip to content

Commit

Permalink
Fixed display of GPU fans
Browse files Browse the repository at this point in the history
  • Loading branch information
TTLC198 committed Dec 4, 2023
1 parent bd22fcb commit bc45d10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions HSMonitor/ViewModels/DashboardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ private set

public GpuFan GpuFan1
{
get => _gpu is {GpuFans: null} ? new GpuFan() : _gpu.GpuFans.ToArray()[0];
get => _gpu is {GpuFans: null} ? new GpuFan() : _gpu.GpuFans.ToArray().ElementAtOrDefault(0) ?? new GpuFan();
set
{
if (_gpu is {GpuFans: null}) return;
if (_gpu is {GpuFans: null} || _gpu.GpuFans.ToArray().ElementAtOrDefault(0) is null) return;
_gpu.GpuFans.ToArray()[0] = value;
OnPropertyChanged();
}
}

public GpuFan GpuFan2
{
get => _gpu is {GpuFans: null} ? new GpuFan() : _gpu.GpuFans.ToArray()[1];
get => _gpu is {GpuFans: null} ? new GpuFan() : _gpu.GpuFans.ToArray().ElementAtOrDefault(1) ?? new GpuFan();
set
{
if (_gpu is {GpuFans: null}) return;
if (_gpu is {GpuFans: null} || _gpu.GpuFans.ToArray().ElementAtOrDefault(1) is null) return;
_gpu.GpuFans.ToArray()[1] = value;
OnPropertyChanged();
}
Expand Down

0 comments on commit bc45d10

Please sign in to comment.