diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java index 8737766..b82609e 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java @@ -111,8 +111,7 @@ public class CriteriaJooqFilter { } public CriteriaJooqFilter sort(SortContainer container) { - Assert.isNotNull(container); - if (container.getFieldName() != null) { + if (container != null && container.getFieldName() != null) { this.sorts.add(container); } return this; diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java index 6bd1b7f..e1ce9f3 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java @@ -17,10 +17,6 @@ public class SortContainer { this.type = type; } - public static SortContainer empty() { - return new SortContainer(null); - } - public static SortContainer of(String fieldName) { Assert.isNotNull(fieldName); return new SortContainer(fieldName);