The Free Software Media System - Server Backend & API
add guide data error handling
Luke Pulverentie20ca8f407fd
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.csindex 1a5ebedc2a..fd2e32ccab 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.ListingschannelNumber = 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");