]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaw
authorStephane Gamard <stephane.gamard@searchbox.com>
Thu, 14 Aug 2014 11:11:11 +0000 (13:11 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Thu, 14 Aug 2014 11:28:49 +0000 (13:28 +0200)
server/sonar-search/src/main/java/org/sonar/search/SearchServer.java

index 14d28abd45c08911c02627c88b361c6d87393267..d93136aad8fa94af860d9d25ca80e56f2746cf27 100644 (file)
@@ -224,10 +224,12 @@ public class SearchServer extends MonitoredProcess {
   }
 
   private File esHomeDir() {
-    if (!props.contains(SONAR_PATH_HOME)) {
+    String homeDir = props.of(SONAR_PATH_HOME);
+    if (StringUtils.isEmpty(homeDir)) {
       throw new IllegalStateException("property 'sonar.path.home' is required");
+    } else {
+      return new File(homeDir);
     }
-    return new File(props.of(SONAR_PATH_HOME));
   }
 
   private File esDataDir() {