From b5e9c28992a4eb60eadef82921fb9b31d3bbc0dc Mon Sep 17 00:00:00 2001 From: Emrah KONDUR Date: Thu, 22 Aug 2024 18:07:28 +0300 Subject: [PATCH] #140 fixed NRE issue when ordering (#142) Co-authored-by: Emrah Kondur --- DatatableJS.Net/Builders/OrderBuilder.cs | 2 +- DatatableJS/Builders/OrderBuilder.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DatatableJS.Net/Builders/OrderBuilder.cs b/DatatableJS.Net/Builders/OrderBuilder.cs index 8de302c..07f4244 100644 --- a/DatatableJS.Net/Builders/OrderBuilder.cs +++ b/DatatableJS.Net/Builders/OrderBuilder.cs @@ -35,7 +35,7 @@ public OrderBuilder Add(Expression> property, OrderBy o var propertyName = ExpressionHelpers.PropertyName(property); var column = _grid._columns - .Where(c => c.Data.Equals(propertyName)) + .Where(c => c.Data != null && c.Data.Equals(propertyName)) .FirstOrDefault(); if (column == null) diff --git a/DatatableJS/Builders/OrderBuilder.cs b/DatatableJS/Builders/OrderBuilder.cs index 930ed86..b02d774 100644 --- a/DatatableJS/Builders/OrderBuilder.cs +++ b/DatatableJS/Builders/OrderBuilder.cs @@ -35,7 +35,7 @@ public OrderBuilder Add(Expression> property, OrderBy o var propertyName = ExpressionHelpers.PropertyName(property); var column = _grid._columns - .Where(c => c.Data.Equals(propertyName)) + .Where(c => c.Data != null && c.Data.Equals(propertyName)) .FirstOrDefault(); if (column == null)