3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-19 09:20:08 +01:00

fix: only write copied value if non null (#2802)

-  fixes #2801
Dieser Commit ist enthalten in:
Jordan 2024-06-26 21:12:36 +02:00 committet von GitHub
Ursprung 75af797d4c
Commit 6dd779f90b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -320,10 +320,11 @@ public class Config {
String node = toNodeName(field.getName()); String node = toNodeName(field.getName());
node = parentNode == null ? node : parentNode + "." + node; node = parentNode == null ? node : parentNode + "." + node;
Map.Entry<String, Object> entry = copyTo.remove(node); Map.Entry<String, Object> entry = copyTo.remove(node);
Object copiedVal;
if (entry == null) { if (entry == null) {
copyTo.put(node,new AbstractMap.SimpleEntry<>(copiedFrom.value(), null)); copyTo.put(node, new AbstractMap.SimpleEntry<>(copiedFrom.value(), null));
} else { } else if ((copiedVal = entry.getValue()) != null) {
field.set(instance, entry.getValue()); field.set(instance, copiedVal);
} }
} }
Create create = field.getAnnotation(Create.class); Create create = field.getAnnotation(Create.class);