use isdbnull instead of cast

pull/702/head
Luke Pulverenti 12 years ago
parent d7cc4738e6
commit 1d826741f3

@ -283,11 +283,9 @@ namespace MediaBrowser.Server.Implementations.Sqlite
userdata.IsFavorite = reader.GetBoolean(3);
userdata.Played = reader.GetBoolean(4);
var ticks = (long?) reader.GetValue(5);
if (ticks.HasValue)
if (!reader.IsDBNull(5))
{
userdata.LastPlayedDate = new DateTime(ticks.Value);
userdata.LastPlayedDate = new DateTime(reader.GetInt64(5));
}
}
}

Loading…
Cancel
Save