CLOUDSTACK-3274: guard a null string case in case of string match.

This commit is contained in:
Min Chen 2013-08-16 10:51:25 -07:00
parent 97ff4981c5
commit 8202acdbc1
1 changed files with 4 additions and 2 deletions

View File

@ -153,8 +153,10 @@ public class StringUtils {
// Responsible for stripping sensitive content from request and response strings
public static String cleanString(String stringToClean){
String cleanResult = "";
cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll("");
cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll("");
if (stringToClean != null) {
cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll("");
cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll("");
}
return cleanResult;
}