浏览代码

add error checking

Luke Pulverenti 9 年之前
父节点
当前提交
e321d3c544
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

+ 11 - 1
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -498,7 +498,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
         private bool IsListingProviderEnabledForTuner(ListingsProviderInfo info, string tunerHostId)
         {
-            return info.EnableAllTuners || info.EnabledTuners.Contains(tunerHostId ?? string.Empty, StringComparer.OrdinalIgnoreCase);
+            if (info.EnableAllTuners)
+            {
+                return true;
+            }
+
+            if (string.IsNullOrWhiteSpace(tunerHostId))
+            {
+                throw new ArgumentNullException("tunerHostId");
+            }
+
+            return info.EnabledTuners.Contains(tunerHostId, StringComparer.OrdinalIgnoreCase);
         }
 
         private async Task<IEnumerable<ProgramInfo>> GetProgramsAsyncInternal(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)