diff --git a/capa/rules/__init__.py b/capa/rules/__init__.py index 09649d015..04ea11bd2 100644 --- a/capa/rules/__init__.py +++ b/capa/rules/__init__.py @@ -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] = {