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.
This commit is contained in:
Ludy87
2026-06-13 22:13:16 +02:00
parent cad2ac206a
commit 351abf54a1
@@ -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(