aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-01-28 13:04:38 +0300
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-01-28 13:04:38 +0300
commit9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9 (patch)
tree8f92d7b765882af6c64ade92b8e15de0f50b87f9
parent5c05c7d812a97fd6ab07b5ae7449f5e95d0f6546 (diff)
downloadsonarqube-9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9.tar.gz
sonarqube-9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9.zip
SONAR-2148: Fix NPE in JavaUtils
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
index 26ee5d17425..abbc8a5fa48 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
@@ -68,10 +68,16 @@ public final class JavaUtils {
}
public static String getSourceVersion(Project project) {
- return project.getConfiguration().getString(JAVA_SOURCE_PROPERTY);
+ if (project.getConfiguration() != null) {
+ return project.getConfiguration().getString(JAVA_SOURCE_PROPERTY);
+ }
+ return null;
}
public static String getTargetVersion(Project project) {
- return project.getConfiguration().getString(JAVA_TARGET_PROPERTY);
+ if (project.getConfiguration() != null) {
+ return project.getConfiguration().getString(JAVA_TARGET_PROPERTY);
+ }
+ return null;
}
}