You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/06/25 04:01:38 UTC
[camel] 08/12: Fixed NPE
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
commit eaf1ae028543e0d535a045994dd86dcbf9d5072e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jun 24 14:57:36 2019 +0200
Fixed NPE
---
.../main/java/org/apache/camel/main/MainSupport.java | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
index 9aec640..ac8a5a2 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
@@ -905,17 +905,19 @@ public abstract class MainSupport extends ServiceSupport {
Properties prop = new OrderedProperties();
try {
InputStream is = camelContext.getClassResolver().loadResourceAsStream("/META-INF/services/org/apache/camel/autowire.properties");
- prop.load(is);
- if (!prop.isEmpty()) {
- LOG.info("Loaded {} properties from classpath: META-INF/services/org/apache/camel/autowire.properties", prop.size());
- if (LOG.isDebugEnabled()) {
- LOG.debug("Properties from classpath: META-INF/services/org/apache/camel/autowire.properties:");
- for (String key : prop.stringPropertyNames()) {
- LOG.debug(" {}={}", key, prop.getProperty(key));
+ if (is != null) {
+ prop.load(is);
+ if (!prop.isEmpty()) {
+ LOG.info("Loaded {} properties from classpath: META-INF/services/org/apache/camel/autowire.properties", prop.size());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Properties from classpath: META-INF/services/org/apache/camel/autowire.properties:");
+ for (String key : prop.stringPropertyNames()) {
+ LOG.debug(" {}={}", key, prop.getProperty(key));
+ }
}
}
+ IOHelper.close(is);
}
- IOHelper.close(is);
} catch (Throwable e) {
// ignore as this file is optional
}