diff --git a/pmd/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java b/pmd/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java index 841df1b6e4..f9df6c6927 100644 --- a/pmd/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java +++ b/pmd/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java @@ -251,11 +251,13 @@ public class RuleSetReferenceId { */ public static List parse(String referenceString) { List references = new ArrayList(); - if (referenceString.indexOf(',') == -1) { - references.add(new RuleSetReferenceId(referenceString)); - } else { - for (String name : referenceString.split(",")) { - references.add(new RuleSetReferenceId(name)); + if (referenceString != null && referenceString.trim().length() > 0) { + if (referenceString.indexOf(',') == -1) { + references.add(new RuleSetReferenceId(referenceString)); + } else { + for (String name : referenceString.split(",")) { + references.add(new RuleSetReferenceId(name)); + } } } return references; diff --git a/pmd/src/main/java/net/sourceforge/pmd/processor/AbstractPMDProcessor.java b/pmd/src/main/java/net/sourceforge/pmd/processor/AbstractPMDProcessor.java index fa063bcd48..d17b273ea7 100644 --- a/pmd/src/main/java/net/sourceforge/pmd/processor/AbstractPMDProcessor.java +++ b/pmd/src/main/java/net/sourceforge/pmd/processor/AbstractPMDProcessor.java @@ -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(); } }