diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-28 13:04:38 +0300 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-28 13:04:38 +0300 |
commit | 9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9 (patch) | |
tree | 8f92d7b765882af6c64ade92b8e15de0f50b87f9 /sonar-java-api | |
parent | 5c05c7d812a97fd6ab07b5ae7449f5e95d0f6546 (diff) | |
download | sonarqube-9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9.tar.gz sonarqube-9dca07758ff17e8eeca9fa18dd6a0727f26b3bd9.zip |
SONAR-2148: Fix NPE in JavaUtils
Diffstat (limited to 'sonar-java-api')
-rw-r--r-- | sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java | 10 |
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; } } |