Skip to content

Commit d0c74c8

Browse files
authored
Update ControllerMethodWriter.java (#211)
1 parent 13e42b8 commit d0c74c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerMethodWriter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ void write(boolean requestScoped) {
100100
}
101101

102102
private void writeContextReturn() {
103+
104+
if (instrumentContext) {
105+
writer
106+
.append(" if (ctx.resultInputStream() != null || ctx.res().isCommitted()) return;")
107+
.eol();
108+
}
109+
103110
// Support for CompletableFuture's.
104111
final UType type = UType.parse(method.returnType());
105112
if ("java.util.concurrent.CompletableFuture".equals(type.mainType())) {

0 commit comments

Comments
 (0)