aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorLuis Miguel Almánzar <ruisu15@gmail.com>2013-11-02 21:19:43 -0400
committerLuis Miguel Almánzar <ruisu15@gmail.com>2013-11-02 21:19:43 -0400
commitce8821c94256e365a217480c077c7f0c4cb42b2c (patch)
tree59952b63e492f6cb2a3da2986c17245166b98b6b /MediaBrowser.Server.Implementations/Sorting
parent8a0606e9704f98e368cea4a1391b21fb7e2dec03 (diff)
parent96d4b9c43b69c0a31196487994476024d3d8b13b (diff)
Merge branch 'master' of 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;
}