]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 - Fixed AppTest (NPE when App is not started)
authorStephane Gamard <stephane.gamard@searchbox.com>
Fri, 25 Jul 2014 05:17:31 +0000 (07:17 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Fri, 25 Jul 2014 05:17:31 +0000 (07:17 +0200)
sonar-application/src/main/java/org/sonar/application/App.java

index a2b63eab3e8fc8deb213bee892b126fd0cb44935..9be3956c795977e100924a1b2405b10c215957a1 100644 (file)
@@ -124,8 +124,12 @@ public class App implements ProcessMXBean {
       logger.info("Shutting down server");
       monitor.interrupt();
       monitor = null;
-      elasticsearch.terminate();
-      server.terminate();
+      if (elasticsearch != null) {
+        elasticsearch.terminate();
+      }
+      if (server != null) {
+        server.terminate();
+      }
     }
   }