diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-14 13:11:11 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-14 13:28:49 +0200 |
commit | ce81c9ae7b6fb6748172cf5beb28c55246bacd57 (patch) | |
tree | e44aca95466567c4081112afa0d75d06fb2d1f36 /server/sonar-search | |
parent | 912592476de2e245763ae94079dab3849f8b424a (diff) | |
download | sonarqube-ce81c9ae7b6fb6748172cf5beb28c55246bacd57.tar.gz sonarqube-ce81c9ae7b6fb6748172cf5beb28c55246bacd57.zip |
fix quality flaw
Diffstat (limited to 'server/sonar-search')
-rw-r--r-- | server/sonar-search/src/main/java/org/sonar/search/SearchServer.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index 14d28abd45c..d93136aad8f 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -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() { |