Skip to content

Commit b5e9c28

Browse files
ekonduremrahkondur
andauthored
#140 fixed NRE issue when ordering (#142)
Co-authored-by: Emrah Kondur <emrah.kondur@invicti.com>
1 parent a4c6ef9 commit b5e9c28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DatatableJS.Net/Builders/OrderBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public OrderBuilder<T> Add<TProp>(Expression<Func<T, TProp>> property, OrderBy o
3535
var propertyName = ExpressionHelpers<T>.PropertyName(property);
3636

3737
var column = _grid._columns
38-
.Where(c => c.Data.Equals(propertyName))
38+
.Where(c => c.Data != null && c.Data.Equals(propertyName))
3939
.FirstOrDefault();
4040

4141
if (column == null)

DatatableJS/Builders/OrderBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public OrderBuilder<T> Add<TProp>(Expression<Func<T, TProp>> property, OrderBy o
3535
var propertyName = ExpressionHelpers<T>.PropertyName(property);
3636

3737
var column = _grid._columns
38-
.Where(c => c.Data.Equals(propertyName))
38+
.Where(c => c.Data != null && c.Data.Equals(propertyName))
3939
.FirstOrDefault();
4040

4141
if (column == null)

0 commit comments

Comments
 (0)