knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1288 - NPE during service discovery
Date Wed, 02 May 2018 14:11:25 GMT
Repository: knox
Updated Branches:
  refs/heads/master 1afbbea2e -> fc0e59a9c


KNOX-1288 - NPE during service discovery


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/fc0e59a9
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/fc0e59a9
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/fc0e59a9

Branch: refs/heads/master
Commit: fc0e59a9cf6eb77ef7f516591d9cdab5d413332f
Parents: 1afbbea
Author: Phil Zampino <pzampino@apache.org>
Authored: Wed May 2 09:55:20 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Wed May 2 09:55:20 2018 -0400

----------------------------------------------------------------------
 .../discovery/ambari/AmbariServiceDiscovery.java    | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/fc0e59a9/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariServiceDiscovery.java
----------------------------------------------------------------------
diff --git a/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariServiceDiscovery.java
b/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariServiceDiscovery.java
index 4264bc6..392909d 100644
--- a/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariServiceDiscovery.java
+++ b/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariServiceDiscovery.java
@@ -287,13 +287,15 @@ class AmbariServiceDiscovery implements ServiceDiscovery {
             String configType = componentServiceConfigs.get(componentName);
             if (configType != null) {
                 AmbariCluster.ServiceConfiguration svcConfig = configs.get(configType);
-                AmbariComponent c = new AmbariComponent(componentName,
-                                                        svcConfig.getVersion(),
-                                                        clusterName,
-                                                        serviceName,
-                                                        hostNames,
-                                                        svcConfig.getProperties());
-                cluster.addComponent(c);
+                if (svcConfig != null) {
+                    AmbariComponent c = new AmbariComponent(componentName,
+                                                            svcConfig.getVersion(),
+                                                            clusterName,
+                                                            serviceName,
+                                                            hostNames,
+                                                            svcConfig.getProperties());
+                    cluster.addComponent(c);
+                }
             }
         }
 


Mime
View raw message