Skip to content

Commit 6f3d74e

Browse files
author
Reginald C Cole
committed
Prevent Hibernate exception from showing.
- note: This is not a fix for the actual sorting of parent categories; this is just a fix for the stacktrace showing in modal. - Addresses BroadleafCommerce/QA#1301
1 parent 4f42405 commit 6f3d74e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

admin/broadleaf-admin-module/src/main/java/org/broadleafcommerce/admin/server/service/handler/ProductCustomPersistenceHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ public Long transform(Object input) {
176176
criteria.select(root.get("product").get("id").as(Long.class));
177177
List<Predicate> restrictions = new ArrayList<Predicate>();
178178
restrictions.add(builder.equal(root.get("defaultReference"), Boolean.TRUE));
179-
restrictions.add(root.get("category").get("id").in(transformedValues));
179+
if (!transformedValues.isEmpty()) {
180+
restrictions.add(root.get("category").get("id").in(transformedValues));
181+
}
180182
//archived?
181183
QueryUtils.notArchived(builder, restrictions, root, "archiveStatus");
182184
criteria.where(restrictions.toArray(new Predicate[restrictions.size()]));

0 commit comments

Comments
 (0)