search_text: additionalInfo == null

This commit is contained in:
nickAS21 2023-05-26 21:56:45 +03:00
parent 7076c1719f
commit 1d35acd340

View File

@ -100,7 +100,8 @@ public abstract class BaseDataWithAdditionalInfo<I extends UUIDBased> extends Ba
public static void setJson(JsonNode json, Consumer<JsonNode> jsonConsumer, Consumer<byte[]> bytesConsumer) { public static void setJson(JsonNode json, Consumer<JsonNode> jsonConsumer, Consumer<byte[]> bytesConsumer) {
jsonConsumer.accept(json); jsonConsumer.accept(json);
try { try {
bytesConsumer.accept(mapper.writeValueAsBytes(json)); byte[] jsonConsumerToBytes = json == null ? null : mapper.writeValueAsBytes(json);
bytesConsumer.accept(jsonConsumerToBytes);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
log.warn("Can't serialize json data: ", e); log.warn("Can't serialize json data: ", e);
} }