Skip to content

Commit

Permalink
Call method in case if response type is void
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzhinsky committed Oct 15, 2023
1 parent f4fad4c commit 9e390b0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ private CodeBlock generateAbstractMethodCall() {
);
} else {
CodeBlock methodCall = CodeBlock.of("$N($L)", abstractMethodSpec, requestCallParams);
methodCall = responseTypeModel().toGrpcTransformer(methodCall);
return CodeBlock.of("responseObserver.onNext($L);", methodCall);
if (responseType != null && responseType.getTypeName() == TypeName.VOID) {
return CodeBlock.of("$L;\nresponseObserver.onNext($L);",
methodCall, responseTypeModel().toGrpcTransformer(methodCall));
} else {
methodCall = responseTypeModel().toGrpcTransformer(methodCall);
return CodeBlock.of("responseObserver.onNext($L);", methodCall);
}
}
}

Expand Down

0 comments on commit 9e390b0

Please sign in to comment.