Skip to content

Commit 2ff59ab

Browse files
committed
Fixed potential NPE in EncodeQuery
1 parent 27627ed commit 2ff59ab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎impl-servlet/src/main/java/com/ocpsoft/rewrite/servlet/config/EncodeQuery.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void perform(final Rewrite event, final EvaluationContext context)
154154
String newUrl = in.getRequestPath() + "?" + decoded;
155155
in.forward(newUrl);
156156
}
157-
else
157+
else if (onfailure != null)
158158
{
159159
onfailure.perform(event, context);
160160
}

‎showcase/rest-ws/src/main/java/com/ocpsoft/rewrite/showcase/rest/RestRewriteConfiguration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Configuration getConfiguration(final ServletContext context)
5757
*/
5858
.when(Method.isGet()
5959
.and(Path.matches("/store/product/{pid}")
60-
.where("pid")
60+
.where("pid").matches("\\d+")
6161
.bindsTo(Evaluation.property("pid").convertedBy(ProductConverter.class)
6262
.validatedBy(ProductValidator.class))))
6363
.perform(new HttpOperation() {

0 commit comments

Comments
 (0)