fix Nullpointer Exception when using -l jsp

This commit is contained in:
Peter Kofler 2013-03-23 15:42:02 +01:00 committed by Andreas Dangel
parent b6c6899741
commit 00e27b4a37

View File

@ -118,7 +118,11 @@ public class PMDParameters {
configuration.setSuppressMarker(params.getSuppressmarker());
configuration.setThreads(params.getThreads());
for ( LanguageVersion language : LanguageVersion.findVersionsForLanguageTerseName( params.getLanguage() ) ) {
configuration.getLanguageVersionDiscoverer().setDefaultLanguageVersion(language.getLanguage().getVersion(params.getVersion()));
LanguageVersion languageVersion = language.getLanguage().getVersion(params.getVersion());
if (languageVersion == null) {
languageVersion = language.getLanguage().getDefaultVersion();
}
configuration.getLanguageVersionDiscoverer().setDefaultLanguageVersion(languageVersion);
}
try {
configuration.prependClasspath(params.getAuxclasspath());