aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs b/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
index ef589e1fa..ffe1fc24a 100644
--- a/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs
@@ -35,7 +35,14 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (x.ProductionYear.HasValue)
{
- return new DateTime(x.ProductionYear.Value, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ try
+ {
+ return new DateTime(x.ProductionYear.Value, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ }
+ catch (ArgumentOutOfRangeException)
+ {
+ // Don't blow up if the item has a bad ProductionYear, just return MinValue
+ }
}
return DateTime.MinValue;
}