Fixed mysql not checking if the column data is not null.
This commit is contained in:
parent
4cf35a3093
commit
ecb843ec5a
1 changed files with 3 additions and 0 deletions
|
|
@ -97,6 +97,9 @@ namespace TShockAPI.DB
|
||||||
|
|
||||||
public static T Get<T>(this IDataReader reader, int column)
|
public static T Get<T>(this IDataReader reader, int column)
|
||||||
{
|
{
|
||||||
|
if (reader.IsDBNull(column))
|
||||||
|
return default(T);
|
||||||
|
|
||||||
if (ReadFuncs.ContainsKey(typeof(T)))
|
if (ReadFuncs.ContainsKey(typeof(T)))
|
||||||
return (T)ReadFuncs[typeof(T)](reader, column);
|
return (T)ReadFuncs[typeof(T)](reader, column);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue