Skip to content

Commit

Permalink
main.py: add asserts for checking filters are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yelhamer committed Aug 20, 2024
1 parent b0d8071 commit ac50103
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions capa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,10 @@ def get_extractor_filters_from_cli(args, input_format) -> FilterConfig:

def apply_extractor_filters(extractor: FeatureExtractor, extractor_filters: FilterConfig):
if isinstance(extractor, StaticFeatureExtractor):
assert extractor_filters["functions"]
return FunctionFilter(extractor, extractor_filters["functions"])
elif isinstance(extractor, DynamicFeatureExtractor):
assert extractor_filters["processes"]
return ProcessFilter(extractor, extractor_filters["processes"])
else:
raise ShouldExitError(E_INVALID_FEATURE_EXTRACTOR)
Expand Down

0 comments on commit ac50103

Please sign in to comment.