SPR-7314 - RestTemplate does not handle null uri template parameters
This commit is contained in:
@@ -125,8 +125,9 @@ public class UriTemplate {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
int i = 0;
|
||||
while (matcher.find()) {
|
||||
String uriVariable = uriVariableValues[i++].toString();
|
||||
matcher.appendReplacement(buffer, Matcher.quoteReplacement(uriVariable));
|
||||
Object uriVariable = uriVariableValues[i++];
|
||||
String replacement = Matcher.quoteReplacement(uriVariable != null ? uriVariable.toString() : "");
|
||||
matcher.appendReplacement(buffer, replacement);
|
||||
}
|
||||
matcher.appendTail(buffer);
|
||||
return encodeUri(buffer.toString());
|
||||
|
||||
Reference in New Issue
Block a user