aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-11-14 00:35:13 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-11-14 00:35:13 +0100
commit516843673ead46c379c57f61dd5848b92e11e6e8 (patch)
tree758aa93d7126f203b3ebc023f393fc300363d22c /sonar-batch
parentda335cf4e8206cc726fd7185c2a7673544dc1a77 (diff)
downloadsonarqube-516843673ead46c379c57f61dd5848b92e11e6e8.tar.gz
sonarqube-516843673ead46c379c57f61dd5848b92e11e6e8.zip
Fix potential NPE in Gradle task
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/Batch.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/Batch.java b/sonar-batch/src/main/java/org/sonar/batch/Batch.java
index d10b89398f9..ef964b991ac 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/Batch.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/Batch.java
@@ -65,11 +65,14 @@ public final class Batch {
/**
* Used by Gradle 1.0
- * @deprecated
+ *
+ * @deprecated
*/
@Deprecated
public static Batch create(ProjectReactor projectReactor, Configuration configuration, Object... bootstrapperComponents) {
- projectReactor.getRoot().setProperties(convertToProperties(configuration));
+ if (configuration != null) {
+ projectReactor.getRoot().setProperties(convertToProperties(configuration));
+ }
return new Batch(projectReactor, bootstrapperComponents);
}
@@ -77,7 +80,7 @@ public final class Batch {
Properties props = new Properties();
Iterator keys = configuration.getKeys();
while (keys.hasNext()) {
- String key = (String)keys.next();
+ String key = (String) keys.next();
// Configuration#getString() automatically splits strings by comma separator.
String value = StringUtils.join(configuration.getStringArray(key), ",");
props.setProperty(key, value);