Fix crash in validate_parent_type

If the type being checked for is not found (e.g. the library is not
installed or is out of date), parent.full_name would be None.
This commit is contained in:
James Westman 2024-05-30 17:51:40 -05:00
parent 25d08e56cb
commit 442fff69b6

View file

@ -110,7 +110,7 @@ def validate_parent_type(node, ns: str, name: str, err_msg: str):
container_type = node.parent_by_type(Object).gir_class container_type = node.parent_by_type(Object).gir_class
if container_type and not container_type.assignable_to(parent): if container_type and not container_type.assignable_to(parent):
raise CompileError( raise CompileError(
f"{container_type.full_name} is not a {parent.full_name}, so it doesn't have {err_msg}" f"{container_type.full_name} is not a {ns}.{name}, so it doesn't have {err_msg}"
) )