From 7f652e38f0ae8317f96abbbc18336770bb0525a0 Mon Sep 17 00:00:00 2001 From: Hannes Date: Fri, 5 Jun 2020 12:32:34 +0200 Subject: [PATCH] fix nullpointer in category search --- .../hso/ecommerce/controller/shop/ShopSearchController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java index cacdafe..47b8acf 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java @@ -32,9 +32,8 @@ public class ShopSearchController { ) { model.addAttribute("categories", categoryRepository.getCategories()); //for sidebar - term = term.trim(); - if (term != null) { //if search by Term + term = term.trim(); List
articles = SearchByTermAction.searchByTerm(term, articleRepository); model.addAttribute("articles", articles); } else if (category != null) { //if search by Category