mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
Check for nil filter (#714)
This commit is contained in:
parent
67004fe68a
commit
af34a6a108
1 changed files with 3 additions and 0 deletions
|
@ -86,6 +86,9 @@ func FilterRulesFromFile(source string) (*FilterRuleSet, error) {
|
|||
|
||||
// Pass returns true if the include FilterRuleSet matches the pattern and the exclude FilterRuleSet does not match.
|
||||
func (filter *Filter) Pass(object string) bool {
|
||||
if filter == nil {
|
||||
return true
|
||||
}
|
||||
excluded := filter.exclude.Matches(object)
|
||||
included := filter.include.Matches(object)
|
||||
return !excluded && included
|
||||
|
|
Loading…
Reference in a new issue