Skip to content

Commit a177617

Browse files
HttpActivityExecutor: Keep setting variable content to null for Json response with no content.
Jackson 2.10 changed the behavior for ObjectMapper.readTree(input) for no content (see: FasterXML/jackson-databind#2211).
1 parent e3186a5 commit a177617

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/flowable-http/src/main/java/org/flowable/http/HttpActivityExecutor.java

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.slf4j.LoggerFactory;
5454

5555
import com.fasterxml.jackson.databind.ObjectMapper;
56+
import com.fasterxml.jackson.databind.node.MissingNode;
5657

5758
/**
5859
* An executor behavior for HTTP requests.
@@ -116,6 +117,9 @@ public void execute(HttpRequest request, VariableContainer variableContainer, St
116117
if (!response.isBodyResponseHandled()) {
117118
String varName = StringUtils.isNotEmpty(responseVariableName) ? responseVariableName : request.getPrefix() + "ResponseBody";
118119
Object varValue = request.isSaveResponseAsJson() && response.getBody() != null ? objectMapper.readTree(response.getBody()) : response.getBody();
120+
if (varValue instanceof MissingNode) {
121+
varValue = null;
122+
}
119123
if (request.isSaveResponseTransient()) {
120124
variableContainer.setTransientVariable(varName, varValue);
121125
} else {

0 commit comments

Comments
 (0)