This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.x by this push:
new 09fe231 Fixed potential NPE
09fe231 is described below
commit 09fe23176508770b7c89a5e26991323e6965b23e
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Apr 29 12:24:12 2019 +0200
Fixed potential NPE
---
.../camel/runtimecatalog/AbstractCamelCatalog.java | 24 ++++++++++++----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git
a/camel-core/src/main/java/org/apache/camel/runtimecatalog/AbstractCamelCatalog.java
b/camel-core/src/main/java/org/apache/camel/runtimecatalog/AbstractCamelCatalog.java
index 70590b0..98dafd6 100644
---
a/camel-core/src/main/java/org/apache/camel/runtimecatalog/AbstractCamelCatalog.java
+++
b/camel-core/src/main/java/org/apache/camel/runtimecatalog/AbstractCamelCatalog.java
@@ -759,17 +759,19 @@ 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
- CollectionStringBuffer csb = new CollectionStringBuffer("&");
- for (Map.Entry<String, Object> multi : values.entrySet()) {
- String line = prefix + multi.getKey() + "=" +
(multi.getValue() != null ? multi.getValue().toString() : "");
- csb.append(line);
- }
- // append the extra multi-values to the existing (which
contains the first multi value)
- if (!csb.isEmpty()) {
- value = value + "&" + csb.toString();
+ 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
+ CollectionStringBuffer csb = new
CollectionStringBuffer("&");
+ for (Map.Entry<String, Object> multi : values.entrySet()) {
+ String line = prefix + multi.getKey() + "=" +
(multi.getValue() != null ? multi.getValue().toString() : "");
+ csb.append(line);
+ }
+ // append the extra multi-values to the existing (which
contains the first multi value)
+ if (!csb.isEmpty()) {
+ value = value + "&" + csb.toString();
+ }
}
}