Skip to content

Commit 36da149

Browse files
committed
[backend] Wip
1 parent 046eb97 commit 36da149

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openbas-api/src/main/java/io/openbas/rest/inject/service/OutputStructuredUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public Optional<JsonNode> buildStructuredJsonNode(
156156
if (type.fields == null || type.technicalType != ContractOutputTechnicalType.Object) {
157157
String extracted = extractValues(element.getRegexGroups(), matcher);
158158

159+
if (extracted == null) {
160+
return Optional.empty();
161+
}
162+
159163
return type.technicalType == ContractOutputTechnicalType.Number
160164
? Optional.of(toNumericValue(extracted))
161165
: Optional.of(mapper.valueToTree(extracted));

0 commit comments

Comments
 (0)