Skip to content

Commit 24e330b

Browse files
authored
Merge pull request #48373 from geoand/#jackson-exception
Prevent unnecessary exception from being thrown during Jackson serialization problems
2 parents 6b76a56 + e7f4d23 commit 24e330b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

independent-projects/vertx-utils/src/main/java/io/quarkus/vertx/utils/VertxOutputStream.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ private void write(ByteBuf data, boolean last) throws IOException {
102102
data.release();
103103
} else {
104104
if (last) {
105-
request.response().end(createBuffer(data), null);
105+
if (!request.response().ended()) { // can happen when an exception occurs during JSON serialization with Jackson
106+
request.response().end(createBuffer(data), null);
107+
}
106108
} else {
107109
request.response().write(createBuffer(data), null);
108110
}

0 commit comments

Comments
 (0)