mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
fix:字符串NPE
This commit is contained in:
@@ -370,6 +370,9 @@ public class StrUtil extends CharSequenceUtil implements StrPool {
|
||||
* @since 3.0.9
|
||||
*/
|
||||
public static String reverse(String str) {
|
||||
if (null == str) {
|
||||
return null;
|
||||
}
|
||||
return new String(ArrayUtil.reverse(str.toCharArray()));
|
||||
}
|
||||
|
||||
@@ -414,6 +417,9 @@ public class StrUtil extends CharSequenceUtil implements StrPool {
|
||||
* @since 3.1.2
|
||||
*/
|
||||
public static String fill(String str, char filledChar, int len, boolean isPre) {
|
||||
if (null == str) {
|
||||
str = "";
|
||||
}
|
||||
final int strLen = str.length();
|
||||
if (strLen > len) {
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user