Skip to content

Commit b0d036f

Browse files
committed
Safe upgrade
1 parent ae8d0c2 commit b0d036f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/me/rothes/protocolstringreplacer/upgrades/UpgradeHandler5To6.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ protected void upgradeReplacerConfig(@NotNull File file, @NotNull YamlConfigurat
4141
}
4242

4343
private void renameNode(@NotNull YamlConfiguration config, @NotNull String o, @NotNull String n) {
44-
config.set(n, config.get(o));
44+
Object old = config.get(o);
45+
if (old == null) {
46+
return;
47+
}
48+
config.set(n, old);
4549
config.set(o, null);
4650
}
4751

0 commit comments

Comments
 (0)