The Free Software Media System - Server Backend & API
add ArgumentNullExceptions
Luke Pulverenti26978a1f9fd2
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex 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.EmbyTVpublic async Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken){+ if (string.IsNullOrWhiteSpace(channelId))+ {+ throw new ArgumentNullException("channelId");+ }+foreach (var hostInstance in _liveTvManager.TunerHosts){trydiff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.csindex 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.TunerHostspublic 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.TunerHostspublic 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.csindex 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.TunerHostsprotected override bool IsValidChannelId(string channelId){+ if (string.IsNullOrWhiteSpace(channelId))+ {+ throw new ArgumentNullException("channelId");+ }+return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase);}