mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Support template without parent
This commit is contained in:
parent
896dd7f824
commit
adc2be1454
5 changed files with 28 additions and 2 deletions
|
@ -905,7 +905,11 @@ class Namespace(GirNode):
|
|||
def get_type_by_cname(self, cname: str) -> T.Optional[GirType]:
|
||||
"""Gets a type from this namespace by its C name."""
|
||||
for item in self.entries.values():
|
||||
if hasattr(item, "cname") and item.cname == cname:
|
||||
if (
|
||||
hasattr(item, "cname")
|
||||
and item.cname is not None
|
||||
and item.cname == cname
|
||||
):
|
||||
return item
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue