Skip to content

Commit

Permalink
rules: handle unsupported scopes again
Browse files Browse the repository at this point in the history
  • Loading branch information
williballenthin committed Aug 25, 2023
1 parent 17e4765 commit 9bbd318
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion capa/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def from_dict(self, scopes: Dict[str, str]) -> "Scopes":
if scopes_["dynamic"] and scopes_["dynamic"] not in DYNAMIC_SCOPES:
raise InvalidRule(f"{scopes_['dynamic']} is not a valid dynamic scope")

return Scopes(static=Scope(scopes_["static"]), dynamic=Scope(scopes_["dynamic"]))
return Scopes(
static=Scope(scopes_["static"]) if scopes_["static"] else None,
dynamic=Scope(scopes_["dynamic"]) if scopes_["dynamic"] else None,
)


SUPPORTED_FEATURES: Dict[str, Set] = {
Expand Down

0 comments on commit 9bbd318

Please sign in to comment.