Skip to content

Commit

Permalink
fix(3.2): triple AbstractServerCallListener NPE (apache#14009)
Browse files Browse the repository at this point in the history
* fix NPE

* Optimize the handling of exceptions in response

---------

Co-authored-by: caoyanan <caoyanan@growingio.com>
  • Loading branch information
2 people authored and Will-well committed Apr 9, 2024
1 parent c52e36b commit dc22334
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ public void invoke() {
final long stInMillis = System.currentTimeMillis();
try {
final Result response = invoker.invoke(invocation);
if (response.hasException()) {
doOnResponseHasException(response.getException());
return;
}
response.whenCompleteWithContext((r, t) -> {
responseObserver.setResponseAttachments(response.getObjectAttachments());
if (t != null) {
responseObserver.onError(t);
return;
}
if (response.hasException()) {
doOnResponseHasException(response.getException());
if (r.hasException()) {
doOnResponseHasException(r.getException());
return;
}
final long cost = System.currentTimeMillis() - stInMillis;
Expand Down

0 comments on commit dc22334

Please sign in to comment.