Null check. Add ServiceDependencies folder to gitignore.

This commit is contained in:
Jared 2020-12-16 19:02:13 -08:00 committed by Jared Goodwin
parent d940a2a4e3
commit f53b33fb50
2 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@ -286,3 +286,4 @@ Server/wwwroot/Downloads/Win-x86/*
.vscode/launch.json
.vscode/tasks.json
Server/.config/dotnet-tools.json
/Server/Properties/ServiceDependencies/*

View File

@ -952,7 +952,12 @@ namespace Remotely.Server.Services
x.Id == targetUserID &&
x.OrganizationID == orgID);
if (target?.DeviceGroups?.Any() == true)
if (target is null)
{
return;
}
if (target.DeviceGroups?.Any() == true)
{
foreach (var deviceGroup in target.DeviceGroups.ToList())
{