File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
main/java/com/aliyuncs/utils
test/java/com/aliyuncs/utils Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ public static String getUniqueNonce() {
30
30
}
31
31
32
32
public static void validateParameter (String parameter , String parameterName ) {
33
+ if (null == parameter || "" .equals (parameter .trim ())) {
34
+ return ;
35
+ }
33
36
if (Pattern .matches (ParameterHelper .PATTERN , parameter )) {
34
37
return ;
35
38
}
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ public void getUniqueNonce() {
24
24
25
25
@ Test
26
26
public void validateParameterTest () {
27
+ ParameterHelper .validateParameter (" " , "regionId" );
28
+ ParameterHelper .validateParameter ("" , "regionId" );
29
+ ParameterHelper .validateParameter (null , "regionId" );
27
30
ParameterHelper .validateParameter ("cn-hangzhou" , "regionId" );
28
31
try {
29
32
ParameterHelper .validateParameter ("test.test" , "regionId" );
You can’t perform that action at this time.
0 commit comments