Add condition for device no longer existing when filtering users.

This commit is contained in:
Jared Goodwin 2021-05-07 07:53:59 -07:00
parent 4727adaa63
commit cefb7d14a8

View File

@ -2091,6 +2091,11 @@ namespace Remotely.Server.Services
.ThenInclude(x => x.Users)
.FirstOrDefault(x => x.ID == deviceID);
if (device is null)
{
return Array.Empty<string>();
}
var orgUsers = dbContext.Users
.Where(user =>
user.OrganizationID == device.OrganizationID &&