From 408e6ccfcadb4134e4a56cd76a092ddf92034cf1 Mon Sep 17 00:00:00 2001 From: Jonas Arnhold Date: Mon, 7 Oct 2024 18:28:41 +0200 Subject: [PATCH] Fix streamQueryResults in case of a failed SQL query (#3591) --- .../com/bakdata/conquery/sql/execution/SqlExecutionState.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/main/java/com/bakdata/conquery/sql/execution/SqlExecutionState.java b/backend/src/main/java/com/bakdata/conquery/sql/execution/SqlExecutionState.java index 15253a0973..8b189392a0 100644 --- a/backend/src/main/java/com/bakdata/conquery/sql/execution/SqlExecutionState.java +++ b/backend/src/main/java/com/bakdata/conquery/sql/execution/SqlExecutionState.java @@ -38,6 +38,10 @@ public SqlExecutionState(ExecutionState state, List columnNames, List streamQueryResults() { + // when the SQL execution fails, table is null + if (table == null) { + return Stream.empty(); + } return table.stream(); } }