aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-15 16:31:08 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-17 00:15:39 -0400
commite20ca8f407fda5be6b17aac9d34a84621ae56e6b (patch)
treed95a9a4fec90e920665b250415646c4fbd3098aa
parentb0a14a191a19bc990095d28b05a908d11d141b5c (diff)
add guide data error handling
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 1a5ebedc2..fd2e32cca 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -315,9 +315,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
channelNumber = channelNumber.TrimStart('0');
_logger.Debug("Found channel: " + channelNumber + " in Schedules Direct");
- var schChannel = root.stations.FirstOrDefault(item => item.stationID == map.stationID);
-
- AddToChannelPairCache(listingsId, channelNumber, schChannel);
+ if (root.stations != null)
+ {
+ var schChannel = root.stations.FirstOrDefault(item => string.Equals(item.stationID, map.stationID, StringComparison.OrdinalIgnoreCase));
+ if (schChannel != null)
+ {
+ AddToChannelPairCache(listingsId, channelNumber, schChannel);
+ }
+ }
}
_logger.Info("Added " + GetChannelPairCacheCount(listingsId) + " channels to the dictionary");