This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new e497667 CAMEL-16283: Fixed camel-jetty NPE in query parsing
e497667 is described below
commit e497667145102fcfe9e9c32eb3ace4ac61acf53b
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Mar 2 09:59:28 2021 +0100
CAMEL-16283: Fixed camel-jetty NPE in query parsing
---
.../java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
index ed26cd1..1026920 100644
---
a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
+++
b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
@@ -95,12 +95,13 @@ final class AttachmentHttpBinding extends
DefaultHttpBinding {
jettyRequest.getHttpFields().remove(Exchange.CONTENT_ENCODING);
}
+ // attachment is optional
AttachmentMessage am =
message.getExchange().getMessage(AttachmentMessage.class);
Enumeration<?> names = request.getParameterNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
- if (am.getAttachment(name) != null) {
+ if (am != null && am.getAttachment(name) != null) {
DataHandler dh = am.getAttachment(name);
Object value = dh;
if (dh.getContentType() == null ||
dh.getContentType().startsWith("text/plain")) {