Skip to content

Commit

Permalink
Fix null pointer exception for nested where clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Sossmeier committed Nov 14, 2024
1 parent eeb8695 commit 8573fed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/nlpcn/es4sql/parse/SqlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ private void addOrderByToSelect(Select select, List<SQLSelectOrderByItem> items,
if (alias != null) orderByName = orderByName.replaceFirst(alias + "\\.", "");

ScriptSortBuilder.ScriptSortType scriptSortType = judgeIsStringSort(expr);
select.addOrderBy(f.getNestedPath(), orderByName, type, scriptSortType, missing, unmappedType, numericType, format, f.getNested().where);
Where where = f.getNested() != null ? f.getNested().where : null;
select.addOrderBy(f.getNestedPath(), orderByName, type, scriptSortType, missing, unmappedType, numericType, format, where);
}
}

Expand Down

0 comments on commit 8573fed

Please sign in to comment.