Permit the null key, which is written as "null"
This commit is contained in:
parent
d22e11b184
commit
1bb48694f4
@ -96,7 +96,11 @@ public final class GsonCompatibleMapTypeAdapter<V> extends TypeAdapter<Map<Strin
|
||||
|
||||
writer.beginObject();
|
||||
for (Map.Entry<String, V> entry : map.entrySet()) {
|
||||
writer.name(entry.getKey());
|
||||
String key = entry.getKey();
|
||||
if (key == null) {
|
||||
key = "null";
|
||||
}
|
||||
writer.name(key);
|
||||
valueTypeAdapter.write(writer, entry.getValue());
|
||||
}
|
||||
writer.endObject();
|
||||
|
Loading…
Reference in New Issue
Block a user