diff --git a/tools/print_package_xml_version.py b/tools/print_package_xml_version.py index bf50e920..c7eabf60 100755 --- a/tools/print_package_xml_version.py +++ b/tools/print_package_xml_version.py @@ -27,6 +27,9 @@ if root.tag != 'package': raise RuntimeError('Invalid package.xml file, root tag <%s> should be ' % root.tag) +if root.find('version') is None: + raise RuntimeError('Invalid package.xml file, no tag found.') + version_str = root.find('version').text # validate version string using regex from catkin_pkg