Skip to content

Commit 1f51078

Browse files
committed
Add support to read empty yaml files
1 parent e1647ae commit 1f51078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

settings-yaml/src/main/java/com/saicone/settings/source/YamlSettingsSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ public SettingsNode readNode(@Nullable MapNode parent, @Nullable String key, @No
135135
*/
136136
@Nullable
137137
@Contract("!null, _ -> !null")
138-
public <T extends MapNode> T readMapNode(@Nullable T parent, @NotNull MappingNode node) {
139-
if (node.getValue().isEmpty()) {
138+
public <T extends MapNode> T readMapNode(@Nullable T parent, @Nullable MappingNode node) {
139+
if (node == null || node.getValue().isEmpty()) {
140140
return parent;
141141
}
142142
for (NodeTuple tuple : node.getValue()) {

0 commit comments

Comments
 (0)