Backport pull request #11633 from jellyfin/release-10.9.z

Allow empty user id when getting device list

Original-merge: a5d60c4521dd94b084fd8eb7ca99f93d4eda99fa

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
crobibero 2024-05-17 13:51:39 -04:00 committed by Joshua M. Boniface
parent 9b978578ce
commit 77c3ddc7ca

View File

@ -179,7 +179,7 @@ namespace Jellyfin.Server.Implementations.Devices
.SelectMany(d => dbContext.DeviceOptions.Where(o => o.DeviceId == d.DeviceId).DefaultIfEmpty(), (d, o) => new { Device = d, Options = o }) .SelectMany(d => dbContext.DeviceOptions.Where(o => o.DeviceId == d.DeviceId).DefaultIfEmpty(), (d, o) => new { Device = d, Options = o })
.AsAsyncEnumerable(); .AsAsyncEnumerable();
if (userId.HasValue) if (!userId.IsNullOrEmpty())
{ {
var user = _userManager.GetUserById(userId.Value); var user = _userManager.GetUserById(userId.Value);
if (user is null) if (user is null)