From 6b58ea3674ea2aca057c702042ae07652ac88f9e Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Fri, 30 Nov 2018 16:04:07 +0100 Subject: [PATCH] Fix crash when target defined only in export part --- catkin_tools_fetch/lib/dependency_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/catkin_tools_fetch/lib/dependency_parser.py b/catkin_tools_fetch/lib/dependency_parser.py index 9dbcf1f..27039fb 100644 --- a/catkin_tools_fetch/lib/dependency_parser.py +++ b/catkin_tools_fetch/lib/dependency_parser.py @@ -148,9 +148,13 @@ def __update_explicit_values(self, xmldoc, dep_dict): urls_node = xmldoc.getElementsByTagName(url_tag) for item in urls_node: target = Parser.__get_attr('target', item) + if not target: log.warning(" skip xml item: '%s'", item) continue + if target not in dep_dict: + log.warning(" target is not a dependency: '%s'", target) + continue log.debug(" read target:'%s'", target) url = Parser.__get_attr('url', item) if url: