diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index aaf74b5c68..81a6b8508c 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -992,6 +992,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV public async Task> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken) { + if (string.IsNullOrWhiteSpace(channelId)) + { + throw new ArgumentNullException("channelId"); + } + foreach (var hostInstance in _liveTvManager.TunerHosts) { try diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs index ad43a611b8..5fae3f666b 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs @@ -101,6 +101,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts public async Task> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken) { + if (string.IsNullOrWhiteSpace(channelId)) + { + throw new ArgumentNullException("channelId"); + } + if (IsValidChannelId(channelId)) { var hosts = GetTunerHosts(); @@ -161,6 +166,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts public async Task GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken) { + if (string.IsNullOrWhiteSpace(channelId)) + { + throw new ArgumentNullException("channelId"); + } + if (!IsValidChannelId(channelId)) { throw new FileNotFoundException(); diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 756c3377c6..19454abbc0 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -87,6 +87,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts protected override bool IsValidChannelId(string channelId) { + if (string.IsNullOrWhiteSpace(channelId)) + { + throw new ArgumentNullException("channelId"); + } + return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase); }