Compare commits

...

1 Commits

Author SHA1 Message Date
Doug Beatty
e997616e0d Prevent error when node.tags is None 2024-08-02 16:23:39 -07:00
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
kind: Fixes
body: Prevent error when `node.tags` is `None`
time: 2024-08-02T16:22:05.2458-07:00
custom:
Author: dbeatty10
Issue: "10519"

View File

@@ -274,7 +274,11 @@ class TagSelectorMethod(SelectorMethod):
def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[UniqueId]:
"""yields nodes from included that have the specified tag"""
for unique_id, node in self.all_nodes(included_nodes):
if hasattr(node, "tags") and any(fnmatch(tag, selector) for tag in node.tags):
if (
hasattr(node, "tags")
and node.tags
and any(fnmatch(tag, selector) for tag in node.tags)
):
yield unique_id