Skip to content

Commit 5cf5dd3

Browse files
committed
Fixed reported issue
1 parent b77d62b commit 5cf5dd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Mvc.JQuery.Datatables/DataTablesFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private static string NumericFilter(string query, string columnname, Type column
114114
}
115115
else
116116
{
117-
return string.Format("({1} as object ?? \"\").ToString().{0}", FilterMethod(query), columnname);
117+
return string.Format("({1} == null ? \"\" : {1}.ToString()).{0}", FilterMethod(query), columnname);
118118
}
119119
}
120120

@@ -166,7 +166,7 @@ private static string GetFilterClause(string query, Tuple<string, Type> column,
166166
return filteredQuery;
167167
}
168168
}
169-
var parts = query.Split('~').Select(q => string.Format("({1} == null ? \"\" : {1}).ToString().{0}", FilterMethod(q), column.Item1));
169+
var parts = query.Split('~').Select(q => string.Format("({1} == null ? \"\" : {1}.ToString()).{0}", FilterMethod(q), column.Item1));
170170
return "(" + string.Join(") OR (", parts) + ")";
171171
}
172172

0 commit comments

Comments
 (0)