From 351abf54a10f23abcfb1ba69eaf1dcebece3617a Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sat, 13 Jun 2026 22:13:16 +0200 Subject: [PATCH] Warn on null form field instead of setting value Split the combined 'case null, default' switch arm into distinct cases. Now a null PDF form field triggers a warning log, while the default branch continues to call setValue(value != null ? value : ""). This improves diagnostics and avoids attempting to set values on null fields. --- .../src/main/java/stirling/software/common/util/FormUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/src/main/java/stirling/software/common/util/FormUtils.java b/app/common/src/main/java/stirling/software/common/util/FormUtils.java index 2f6dbf1537..a1862d379c 100644 --- a/app/common/src/main/java/stirling/software/common/util/FormUtils.java +++ b/app/common/src/main/java/stirling/software/common/util/FormUtils.java @@ -968,7 +968,8 @@ public class FormUtils { case PDPushButton ignored -> log.debug("Ignore Push button"); case PDSignatureField ignored -> log.debug("Skipping signature field '{}'", field.getFullyQualifiedName()); - case null, default -> field.setValue(value != null ? value : ""); + case null -> log.warn("Attempted to set value on null field"); + default -> field.setValue(value != null ? value : ""); } } catch (Exception e) { log.warn(