Skip to content

Commit

Permalink
[hotfix] Fix query result response after database uppgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikriemer committed Feb 11, 2023
1 parent 8351fa0 commit 649f666
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected SpQueryResult postQuery(QueryResult queryResult,
boolean ignoreMissingValues) throws RuntimeException {
SpQueryResult result = new SpQueryResult();

if (queryResult.getResults().get(0).getSeries() != null) {
if (hasResult(queryResult)) {
result.setTotal(queryResult.getResults().get(0).getSeries().size());
queryResult.getResults().get(0).getSeries().forEach(rs -> {
DataSeries series = convertResult(rs, ignoreMissingValues);
Expand All @@ -185,6 +185,12 @@ protected SpQueryResult postQuery(QueryResult queryResult,
return result;
}

private boolean hasResult(QueryResult queryResult) {
return queryResult.getResults() != null
&& queryResult.getResults().size() > 0
&& queryResult.getResults().get(0).getSeries() != null;
}

protected List<QueryElement<?>> getQueryElements() {
List<QueryElement<?>> queryElements = new ArrayList<>();

Expand Down

0 comments on commit 649f666

Please # to comment.