aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-02-12 16:32:00 +0100
committerGitHub <noreply@github.com>2023-02-12 16:32:00 +0100
commit5e074ac945a184fc583703cb9a1d705c0463ef4e (patch)
treef4ede552ec534482fc8caefd6472481e122a89b0 /Jellyfin.Server.Implementations/Devices/DeviceManager.cs
parentf5c970e67ff922808cb5684d1185966e19fd789b (diff)
parenteb7fee95906f1c9d8d104777e0214de9115ca82f (diff)
Merge pull request #9253 from Bond-009/nullref
Diffstat (limited to 'Jellyfin.Server.Implementations/Devices/DeviceManager.cs')
-rw-r--r--Jellyfin.Server.Implementations/Devices/DeviceManager.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
index 8b15d6823..a4b4c1959 100644
--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
@@ -9,6 +9,7 @@ using Jellyfin.Data.Enums;
using Jellyfin.Data.Events;
using Jellyfin.Data.Queries;
using Jellyfin.Extensions;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Devices;
@@ -185,6 +186,10 @@ namespace Jellyfin.Server.Implementations.Devices
if (userId.HasValue)
{
var user = _userManager.GetUserById(userId.Value);
+ if (user is null)
+ {
+ throw new ResourceNotFoundException();
+ }
sessions = sessions.Where(i => CanAccessDevice(user, i.DeviceId));
}