Bladeren bron

AMBARI-7822. Events with Service Checks results in Exceptions in log. Null check.

Siddharth Wagle 10 jaren geleden
bovenliggende
commit
43ab9e61f0

+ 2 - 3
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

@@ -1980,10 +1980,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         Service s = cluster.getService(serviceName);
         // find service component host
         ServiceComponent component = getClientComponentForRunningAction(cluster, s);
-        String componentName = component.getName();
+        String componentName = component != null ? component.getName() : null;
         String clientHost = getClientHostForRunningAction(cluster, s, component);
-        String smokeTestRole =
-            actionMetadata.getServiceCheckAction(serviceName);
+        String smokeTestRole = actionMetadata.getServiceCheckAction(serviceName);
 
         if (clientHost == null || smokeTestRole == null) {
           LOG.info("Nothing to do for service check as could not find role or"