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 791979c Fixed potential NPE
791979c is described below
commit 791979c8e037cba89d538b8f119be374afae42bc
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Apr 29 12:21:50 2019 +0200
Fixed potential NPE
---
.../runtimecatalog/impl/AbstractCamelCatalog.java | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git
a/core/camel-base/src/main/java/org/apache/camel/runtimecatalog/impl/AbstractCamelCatalog.java
b/core/camel-base/src/main/java/org/apache/camel/runtimecatalog/impl/AbstractCamelCatalog.java
index bb2b00c..1023876 100644
---
a/core/camel-base/src/main/java/org/apache/camel/runtimecatalog/impl/AbstractCamelCatalog.java
+++
b/core/camel-base/src/main/java/org/apache/camel/runtimecatalog/impl/AbstractCamelCatalog.java
@@ -765,15 +765,17 @@ public abstract class AbstractCamelCatalog {
boolean multiValued = isPropertyMultiValue(rows, key);
if (multiValued) {
String prefix = getPropertyPrefix(rows, key);
- // extra all the multi valued options
- Map<String, Object> values =
URISupport.extractProperties(parameters, prefix);
- // build a string with the extra multi valued options with the
prefix and & as separator
- String csb = values.entrySet().stream()
- .map(multi -> prefix + multi.getKey() + "=" +
(multi.getValue() != null ? multi.getValue().toString() : ""))
- .collect(Collectors.joining("&"));
- // append the extra multi-values to the existing (which
contains the first multi value)
- if (!csb.isEmpty()) {
- value = value + "&" + csb;
+ if (prefix != null) {
+ // extra all the multi valued options
+ Map<String, Object> values =
URISupport.extractProperties(parameters, prefix);
+ // build a string with the extra multi valued options with
the prefix and & as separator
+ String csb = values.entrySet().stream()
+ .map(multi -> prefix + multi.getKey() + "=" +
(multi.getValue() != null ? multi.getValue().toString() : ""))
+ .collect(Collectors.joining("&"));
+ // append the extra multi-values to the existing (which
contains the first multi value)
+ if (!csb.isEmpty()) {
+ value = value + "&" + csb;
+ }
}
}