forked from phoedos/pmd
Merge pull request #31 from hgschmie/npe-fix
Fix NPE with empty rulesets.
This commit is contained in:
commit
80148e6b13
@ -251,6 +251,7 @@ public class RuleSetReferenceId {
|
||||
*/
|
||||
public static List<RuleSetReferenceId> parse(String referenceString) {
|
||||
List<RuleSetReferenceId> references = new ArrayList<RuleSetReferenceId>();
|
||||
if (referenceString != null && referenceString.trim().length() > 0) {
|
||||
if (referenceString.indexOf(',') == -1) {
|
||||
references.add(new RuleSetReferenceId(referenceString));
|
||||
} else {
|
||||
@ -258,6 +259,7 @@ public class RuleSetReferenceId {
|
||||
references.add(new RuleSetReferenceId(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
return references;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public abstract class AbstractPMDProcessor {
|
||||
return factory.createRuleSets(configuration.getRuleSets());
|
||||
} catch (RuleSetNotFoundException rsnfe) {
|
||||
// should not happen: parent already created a ruleset
|
||||
return null;
|
||||
return new RuleSets();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user