Skip to content

Commit 016faea

Browse files
committed
CLOUDSTACK-3274: guard a null string case in case of string match.
1 parent 71b36e8 commit 016faea

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎utils/src/com/cloud/utils/StringUtils.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ public static String getMaskedPasswordForDisplay(String password) {
153153
// Responsible for stripping sensitive content from request and response strings
154154
public static String cleanString(String stringToClean){
155155
String cleanResult = "";
156-
cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll("");
157-
cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll("");
156+
if (stringToClean != null) {
157+
cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll("");
158+
cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll("");
159+
}
158160
return cleanResult;
159161
}
160162

0 commit comments

Comments
 (0)