Add null pointer check which returns the default new AllBranchesFilter instance in null case.
This commit is contained in:
alexeyy 2018-05-02 09:50:06 +03:00
parent 4469baefa4
commit 4ff2e9358c
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,10 @@ public final class BranchFilterFactory {
private BranchFilterFactory() { }
public static BranchFilter newBranchFilter(BranchFilterConfig config) {
if(config == null)
return new AllBranchesFilter();
switch (config.getType()) {
case NameBasedFilter:
return new NameBasedFilter(config.getIncludeBranchesSpec(), config.getExcludeBranchesSpec());