fix(Mock测试): 修复Mock测试没有校验空参数产生的报错问题

修复Mock测试没有校验空参数产生的报错问题
This commit is contained in:
song-tianyang 2022-01-13 15:52:48 +08:00 committed by fit2-zhao
parent 32c06ce462
commit ca9fdcc355
1 changed files with 5 additions and 1 deletions

View File

@ -587,7 +587,11 @@ public class MockApiUtils {
if (charEncoding == null) { if (charEncoding == null) {
charEncoding = "UTF-8"; charEncoding = "UTF-8";
} }
return new String(buffer, charEncoding); if(buffer == null){
return "";
}else {
return new String(buffer, charEncoding);
}
} }
private static String readXml(HttpServletRequest request) { private static String readXml(HttpServletRequest request) {