Skip to content

Commit 38b376b

Browse files
committed
Fixed NPE in QuerySession implementation
1 parent 07a47a0 commit 38b376b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: query/src/main/java/tech/ydb/query/impl/SessionImpl.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,16 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
275275
handleTxMeta(msg.getTxMeta());
276276
}
277277
if (issues.length > 0) {
278-
handler.onIssues(issues);
278+
if (handler != null) {
279+
handler.onIssues(issues);
280+
} else {
281+
logger.trace("{} lost issues message", SessionImpl.this);
282+
}
279283
}
280284
if (msg.hasExecStats()) {
281285
QueryStats old = stats.getAndSet(new QueryStats(msg.getExecStats()));
282286
if (old != null) {
283-
logger.warn("{} got lost previous exec stats {}", SessionImpl.this, old);
287+
logger.warn("{} lost previous exec stats {}", SessionImpl.this, old);
284288
}
285289
}
286290

@@ -289,7 +293,7 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
289293
if (handler != null) {
290294
handler.onNextPart(new QueryResultPart(index, msg.getResultSet()));
291295
} else {
292-
logger.warn("{} got lost result set part with index {}", SessionImpl.this, index);
296+
logger.trace("{} lost result set part with index {}", SessionImpl.this, index);
293297
}
294298
}
295299
}).whenComplete((status, th) -> {

0 commit comments

Comments
 (0)