mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add null check
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user