diff --git a/.gitignore b/.gitignore index c89423a3..24883cca 100644 --- a/.gitignore +++ b/.gitignore @@ -286,3 +286,4 @@ Server/wwwroot/Downloads/Win-x86/* .vscode/launch.json .vscode/tasks.json Server/.config/dotnet-tools.json +/Server/Properties/ServiceDependencies/* \ No newline at end of file diff --git a/Server/Services/DataService.cs b/Server/Services/DataService.cs index 450613bb..edf21fc0 100644 --- a/Server/Services/DataService.cs +++ b/Server/Services/DataService.cs @@ -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()) {