mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add null check
This commit is contained in:
parent
923aa1cf21
commit
549523db6c
@ -72,9 +72,10 @@ public class URLDecoder implements Serializable {
|
|||||||
* @return 解码后的字符串
|
* @return 解码后的字符串
|
||||||
*/
|
*/
|
||||||
public static String decode(String str, Charset charset, boolean isPlusToSpace) {
|
public static String decode(String str, Charset charset, boolean isPlusToSpace) {
|
||||||
if (null == str) {
|
if(null == str || null == charset){
|
||||||
return null;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int length = str.length();
|
final int length = str.length();
|
||||||
if(0 == length){
|
if(0 == length){
|
||||||
return StrUtil.EMPTY;
|
return StrUtil.EMPTY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user