From a4746bdda6ea950ef6f0098de0c23bf11d4c6055 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Fri, 12 Jul 2024 09:34:36 -0400 Subject: Prevent crash when trying to rename unknown type in typearchive --- python/typearchive.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python') diff --git a/python/typearchive.py b/python/typearchive.py index 379c7d4c..60897d94 100644 --- a/python/typearchive.py +++ b/python/typearchive.py @@ -262,6 +262,8 @@ class TypeArchive: :param new_name: New type name """ id = self.get_type_id(old_name) + if id is None: + raise RuntimeError(f"Unknown type {old_name}") return self.rename_type_by_id(id, new_name) def rename_type_by_id(self, id: str, new_name: '_types.QualifiedNameType') -> None: -- cgit v1.3.1