You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NullPointerException: Cannot invoke "java.util.Map.entrySet()" because "map" is null
at com.alibaba.fastjson2.writer.ObjectWriterImplMap.writeWithFilter(ObjectWriterImplMap.java:402)
at com.alibaba.fastjson2.writer.ObjectWriter.writeWithFilter(ObjectWriter.java:121)
at com.alibaba.fastjson2.writer.ObjectWriterImplMap.write(ObjectWriterImplMap.java:322)
at com.alibaba.fastjson2.writer.ObjectWriterAdapter.writeWithFilter(ObjectWriterAdapter.java:399)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriterImplList.write(ObjectWriterImplList.java:254)
at com.alibaba.fastjson2.JSON.toJSONString(JSON.java:980)
The text was updated successfully, but these errors were encountered:
问题描述
嵌套bean,使用filter,比如ValueFilter,当bean中有map且其值为null时,序列化将引发NPE
环境信息
请填写以下信息:
重现步骤
期待的正确结果
正确序列化,输出json
该代码在fastjson1中正常运行
相关日志输出
The text was updated successfully, but these errors were encountered: