Skip to content

Commit

Permalink
Fixed type warning
Browse files Browse the repository at this point in the history
  • Loading branch information
slincoln-aiq committed Nov 7, 2024
1 parent b752206 commit ded519f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sigmaiq/utils/sigmaiq/sigmaiq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ def create_sigma_rule_obj(sigma_rule: Union[SigmaRule, SigmaCollection, dict, st
if isinstance(sigma_rule, (SigmaRule, SigmaCollection)):
return sigma_rule
if isinstance(sigma_rule, list):
return SigmaCollection([create_sigma_rule_obj(s) for s in sigma_rule])
rules = []
for s in sigma_rule:
result = create_sigma_rule_obj(s)
if isinstance(result, SigmaCollection):
rules.extend(result.rules)
else:
rules.append(result)
return SigmaCollection(rules)
if isinstance(sigma_rule, dict):
# Check and convert v1 schema if needed
if _is_v1_schema(sigma_rule):
Expand Down

0 comments on commit ded519f

Please sign in to comment.