fix(NightJson): correctly save empty maps

This commit is contained in:
Martin Prokoph
2025-09-06 21:38:48 +02:00
parent 918748b373
commit f05d0a9f45

View File

@@ -90,7 +90,7 @@ public class NightJson {
StringBuilder mapPairs = new StringBuilder();
Map<?, ?> map = (Map<?, ?>) value;
Iterator<?> it = map.keySet().iterator();
if (it.hasNext()) mapPairs.append("{");
mapPairs.append(it.hasNext() ? "{" : "{}");
while (it.hasNext()) {
Object key = it.next();
Object val = map.get(key);