Skip to content

Commit 0ce99ae

Browse files
authored
Merge pull request #1229 from bonitasoft/fix/1225-NPE-wildfly
fix(1225) avoid NPE on forwarded request in wildfly
2 parents 618525d + 3130559 commit 0ce99ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/org.restlet.ext.servlet/src/org/restlet/ext/servlet/internal/ServletServerAdapter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ public HttpRequest toRequest(ServerCall httpCall) {
8585
for (final Enumeration<String> namesEnum = servletCall.getRequest()
8686
.getAttributeNames(); namesEnum.hasMoreElements();) {
8787
attributeName = namesEnum.nextElement();
88-
result.getAttributes().put(attributeName,
89-
servletCall.getRequest().getAttribute(attributeName));
88+
Object attribute = servletCall.getRequest().getAttribute(attributeName);
89+
if (attribute != null) {
90+
result.getAttributes().put(attributeName, attribute);
91+
}
9092
}
9193
}
9294

0 commit comments

Comments
 (0)