소스 검색

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

Siddharth Wagle 10 년 전
부모
커밋
43ab9e61f0
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

+ 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"