Merge pull request #31 from hgschmie/npe-fix
Fix NPE with empty rulesets.
This commit is contained in:
commit
80148e6b13
@ -251,11 +251,13 @@ public class RuleSetReferenceId {
|
||||
*/
|
||||
public static List<RuleSetReferenceId> parse(String referenceString) {
|
||||
List<RuleSetReferenceId> references = new ArrayList<RuleSetReferenceId>();
|
||||
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;
|
||||
|
@ -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