Skip to content

Commit

Permalink
Account for null (need nullable references enabled).
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Jun 22, 2023
1 parent 4fd3193 commit 0630b2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Server/Hubs/CircuitConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ private async Task SendWakeCommand(Device deviceToWake, IEnumerable<Device> peer
{
foreach (var peerDevice in peerDevices)
{
foreach (var mac in deviceToWake.MacAddresses)
foreach (var mac in deviceToWake.MacAddresses ?? Array.Empty<string>())
{
if (_serviceSessionCache.TryGetConnectionId(peerDevice.ID, out var connectionId))
{
Expand Down
2 changes: 1 addition & 1 deletion Server/Services/DataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public async Task<Result<Device>> AddOrUpdateDevice(Device device)
resultDevice.TotalMemory = device.TotalMemory;
resultDevice.TotalStorage = device.TotalStorage;
resultDevice.AgentVersion = device.AgentVersion;
resultDevice.MacAddresses = device.MacAddresses;
resultDevice.MacAddresses = device.MacAddresses ?? Array.Empty<string>();
resultDevice.LastOnline = DateTimeOffset.Now;
}
else
Expand Down

0 comments on commit 0630b2e

Please sign in to comment.