Selaa lähdekoodia

AMBARI-14928 Ambari throws NPE in kerberos mode U14/S11 (dsen)

Dmytro Sen 9 vuotta sitten
vanhempi
commit
83bef413c4

+ 8 - 4
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java

@@ -794,10 +794,14 @@ public class AmbariServer {
   }
 
   public void stop() throws Exception {
-    try {
-      server.stop();
-    } catch (Exception e) {
-      LOG.error("Error stopping the server", e);
+    if (server == null) {
+      throw new AmbariException("Error stopping the server");
+    } else {
+      try {
+        server.stop();
+      } catch (Exception e) {
+        LOG.error("Error stopping the server", e);
+      }
     }
   }