This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new e647de7d18 ISIS-2297: commons: make YAML writer null-safe
e647de7d18 is described below
commit e647de7d18b76173a3cac1b1fb8633bac80d437f
Author: Andi Huber <[email protected]>
AuthorDate: Sun Nov 6 07:51:17 2022 +0100
ISIS-2297: commons: make YAML writer null-safe
---
.../java/org/apache/causeway/commons/internal/resources/_Yaml.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/commons/src/main/java/org/apache/causeway/commons/internal/resources/_Yaml.java
b/commons/src/main/java/org/apache/causeway/commons/internal/resources/_Yaml.java
index 8cfa5b1c2f..a7a9bf52ff 100644
---
a/commons/src/main/java/org/apache/causeway/commons/internal/resources/_Yaml.java
+++
b/commons/src/main/java/org/apache/causeway/commons/internal/resources/_Yaml.java
@@ -145,6 +145,9 @@ public class _Yaml {
private static String _toString(
final @Nullable Object pojo,
final @Nullable UnaryOperator<DumperOptions> customizer) {
+ if(pojo==null) {
+ return "";
+ }
try(val writer = new StringWriter()){
val defaultOptions = new DumperOptions();
defaultOptions.setIndent(2);