diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-01-17 08:51:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-17 08:51:39 -0700 |
| commit | e7b8d45bbb0f2b832245dae7ac0d401c56cb10a4 (patch) | |
| tree | 6bf0e4b1edf5723f8e08404ac21b4fbc99f63031 /Jellyfin.Api/Controllers/ChannelsController.cs | |
| parent | 484ccf7f284dcd074e06ed90af6cde4864adecea (diff) | |
Use helper function to compare guid (#10825)
Diffstat (limited to 'Jellyfin.Api/Controllers/ChannelsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ChannelsController.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/ChannelsController.cs b/Jellyfin.Api/Controllers/ChannelsController.cs index fdc16ee23..f83c71b57 100644 --- a/Jellyfin.Api/Controllers/ChannelsController.cs +++ b/Jellyfin.Api/Controllers/ChannelsController.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Jellyfin.Api.Helpers; using Jellyfin.Api.ModelBinders; using Jellyfin.Data.Enums; +using Jellyfin.Extensions; using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; @@ -126,7 +127,7 @@ public class ChannelsController : BaseJellyfinApiController [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields) { userId = RequestHelpers.GetUserId(User, userId); - var user = userId.Value.Equals(default) + var user = userId.IsNullOrEmpty() ? null : _userManager.GetUserById(userId.Value); @@ -201,7 +202,7 @@ public class ChannelsController : BaseJellyfinApiController [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] channelIds) { userId = RequestHelpers.GetUserId(User, userId); - var user = userId.Value.Equals(default) + var user = userId.IsNullOrEmpty() ? null : _userManager.GetUserById(userId.Value); |
