diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-11-17 02:06:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-17 02:06:35 -0500 |
| commit | d8f40438d499c7a5caa48fe7b1f05ede83a02f1a (patch) | |
| tree | 29e8c660f108f9efe1d099e20d0a2b04be7bb33e /Emby.Server.Implementations | |
| parent | 43ee35a19c4e5b3a1a4977fbf38bea70c700c6ca (diff) | |
| parent | 5bcc419857f9445bc5964d0518c656090b2ae4ee (diff) | |
Merge pull request #2293 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations')
3 files changed, 20 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index aaf74b5c6..81a6b8508 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<List<MediaSourceInfo>> 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 ad43a611b..5fae3f666 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<List<MediaSourceInfo>> 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<LiveStream> 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 756c3377c..19454abbc 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); } |
