diff options
| author | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
| commit | 850f1c79f1319de56a300c1d62565c9b2793b7d8 (patch) | |
| tree | f307a380c63d80809fed23c7ce2c8a0d0aba5de8 /Emby.Server.Implementations/Session/SessionManager.cs | |
| parent | ef7f6fc8a97118df7f410a7afa2f501f3f4ca3e2 (diff) | |
| parent | 671d801d9f734665d0acbd441246712ad2e3d91f (diff) | |
Merge branch 'master' into feature/DatabaseRefactor
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index cec4022cc..dc37c4f2a 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -344,6 +344,11 @@ namespace Emby.Server.Implementations.Session /// <returns>Task.</returns> private async Task UpdateNowPlayingItem(SessionInfo session, PlaybackProgressInfo info, BaseItem libraryItem, bool updateLastCheckInTime) { + if (session is null) + { + return; + } + if (string.IsNullOrEmpty(info.MediaSourceId)) { info.MediaSourceId = info.ItemId.ToString("N", CultureInfo.InvariantCulture); @@ -676,6 +681,11 @@ namespace Emby.Server.Implementations.Session private BaseItem GetNowPlayingItem(SessionInfo session, Guid itemId) { + if (session is null) + { + return null; + } + var item = session.FullNowPlayingItem; if (item is not null && item.Id.Equals(itemId)) { @@ -795,7 +805,11 @@ namespace Emby.Server.Implementations.Session ArgumentNullException.ThrowIfNull(info); - var session = GetSession(info.SessionId); + var session = GetSession(info.SessionId, false); + if (session is null) + { + return; + } var libraryItem = info.ItemId.IsEmpty() ? null |
