This commit is contained in:
Looly 2022-06-07 15:43:40 +08:00
parent f33783ac1d
commit eba516b7f1

View File

@ -250,7 +250,9 @@ public class ObjectMapper {
*/
private static void mapFromBean(final Object bean, final JSONObject jsonObject, final Filter<MutableEntry<String, Object>> filter) {
final CopyOptions copyOptions = InternalJSONUtil.toCopyOptions(jsonObject.getConfig());
copyOptions.setFieldEditor((entry -> filter.accept(entry) ? entry : null));
if(null != filter){
copyOptions.setFieldEditor((entry -> filter.accept(entry) ? entry : null));
}
BeanUtil.beanToMap(bean, jsonObject, copyOptions);
}
}