Skip to content

Commit

Permalink
fix : Fix news filtering by space with search terms - EXO-64778 (#876)
Browse files Browse the repository at this point in the history
Before this change, when we attempted to filter news by search term and selected space, the space filter was not being applied. This issue was caused by a null pointer exception during the construction of the search news query. This fix addresses this issue
  • Loading branch information
sofyenne committed Jul 10, 2023
1 parent cad86fe commit c3e9816
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public StringBuilder buildQuery(NewsFilter filter) throws Exception {
if (filter.getSearchText() != null && !filter.getSearchText().equals("")) {
String escapedQuoteSearchText = filter.getSearchText().replace("'", "''").replace("\"", "\"\"");
sqlQuery.append("CONTAINS(.,'").append(escapedQuoteSearchText).append("')");
if (!filter.getTagNames().isEmpty()){
if (filter.getTagNames() != null && !filter.getTagNames().isEmpty()){
sqlQuery.append(" OR (");
for (String tagName : filter.getTagNames()) {
sqlQuery.append(" exo:body LIKE '%#").append(tagName).append("%'");
Expand Down

0 comments on commit c3e9816

Please sign in to comment.