Skip to content

Commit 15d1850

Browse files
committed
fix #3264
1 parent fb9dc31 commit 15d1850

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/com/alibaba/fastjson2/writer/ObjectWriterImplMap.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,10 @@ public void writeWithFilter(JSONWriter jsonWriter, Object object, Object fieldNa
617617
String key;
618618
if (entryKey == null) {
619619
key = null;
620+
} else if (entryKey instanceof String) {
621+
key = (String) entryKey;
620622
} else {
621-
key = entryKey.toString();
623+
key = JSON.toJSONString(entryKey, jsonWriter.getContext());
622624
}
623625

624626
if (refDetect) {

0 commit comments

Comments
 (0)