oe.license.list_licenses() passes the result of parse_legacy_license()
straight into walk_license(), which unconditionally iterates
node.children. For LICENSE = "CLOSED" (and for an empty license string)
parse_legacy_license() returns None, so walk_license(None) dereferences
None.children and aborts do_package_qa with:
AttributeError: 'NoneType' object has no attribute 'children'
This breaks packaging for every CLOSED-licensed recipe reaching the
obsolete-license QA check.
Guard the walk against a None node, mirroring the existing "if node:"
check in the neighbouring apply_pkg_license_exclusion().
Fixes: e9d424738d6f ("classes/conf/lib: Parse LICENSE as SPDX Expression")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
for child in node.children:
walk_license(child)
- walk_license(parse_legacy_license(d, licensestr))
+ node = parse_legacy_license(d, licensestr)
+ if node:
+ walk_license(node)
return set(licenses)
def return_spdx(d, license):