aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorSven Van den brande <sven.vandenbrande@outlook.com>2013-11-02 22:39:49 +0100
committerSven Van den brande <sven.vandenbrande@outlook.com>2013-11-02 22:39:49 +0100
commit96d4b9c43b69c0a31196487994476024d3d8b13b (patch)
tree2d81fb9b119689c9cace40af9a42fee7226cb1cd /MediaBrowser.Server.Implementations/Sorting
parent8f7021eb424a89ba0ee5c1acc52d03d149583a1a (diff)
parented34b67f512b07ea2e97f8708811cc4150906f12 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting')
-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;
}