GlobalSerializeMapping增加null检查

This commit is contained in:
Looly 2024-08-30 10:49:08 +08:00
parent c459a0f613
commit baac5d05d4
2 changed files with 4 additions and 3 deletions

View File

@ -2,10 +2,11 @@
# 🚀Changelog
-------------------------------------------------------------------------------------------------------------
# 5.8.32(2024-08-29)
# 5.8.32(2024-08-30)
### 🐣新特性
* 【core 】 FileUtil.getTotalLines()支持CR换行符issue#IAMZYR@Gitee
* 【json 】 GlobalSerializeMapping增加null检查issue#IANH1Y@Gitee
### 🐞Bug修复
* 【http 】 修复getFileNameFromDisposition不符合规范问题issue#IAKBPD@Gitee

View File

@ -91,7 +91,7 @@ public class GlobalSerializeMapping {
* @return 自定义的序列化器或者{@code null}
*/
public static JSONSerializer<? extends JSON, ?> getSerializer(Type type){
if(null == serializerMap) {
if(null == type || null == serializerMap) {
return null;
}
return serializerMap.get(type);
@ -103,7 +103,7 @@ public class GlobalSerializeMapping {
* @return 自定义的反序列化器或者{@code null}
*/
public static JSONDeserializer<?> getDeserializer(Type type){
if(null == deserializerMap) {
if(null == type || null == deserializerMap) {
return null;
}
return deserializerMap.get(type);