You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2023/02/11 21:08:15 UTC

[streampipes] branch rel/0.91.0 updated: [hotfix] Fix query result response after database uppgrade

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch rel/0.91.0
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/rel/0.91.0 by this push:
     new 8c74a489e [hotfix] Fix query result response after database uppgrade
8c74a489e is described below

commit 8c74a489e5fef5a5882a3da28d19929278d0fe45
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sat Feb 11 22:07:31 2023 +0100

    [hotfix] Fix query result response after database uppgrade
---
 .../streampipes/dataexplorer/v4/query/DataExplorerQueryV4.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/v4/query/DataExplorerQueryV4.java b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/v4/query/DataExplorerQueryV4.java
index 05d4f7987..5bb56b375 100644
--- a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/v4/query/DataExplorerQueryV4.java
+++ b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/v4/query/DataExplorerQueryV4.java
@@ -169,7 +169,7 @@ public class DataExplorerQueryV4 {
                                     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);
@@ -185,6 +185,12 @@ public class DataExplorerQueryV4 {
     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<>();