use isdbnull instead of cast
This commit is contained in:
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…
Reference in New Issue
Block a user