add null check

This commit is contained in:
Looly 2023-04-18 00:20:48 +08:00
parent 923aa1cf21
commit 549523db6c

View File

@ -72,9 +72,10 @@ public class URLDecoder implements Serializable {
* @return 解码后的字符串
*/
public static String decode(String str, Charset charset, boolean isPlusToSpace) {
if (null == str) {
return null;
if(null == str || null == charset){
return str;
}
final int length = str.length();
if(0 == length){
return StrUtil.EMPTY;