From: Dmitry Baryshkov Date: Tue, 21 Jul 2026 15:25:43 +0000 (+0300) Subject: license: fix list_licenses() crash on CLOSED and empty licenses X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=05dfd604d93161758e26e189c04491c0541924d1;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git license: fix list_licenses() crash on CLOSED and empty licenses 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 Reviewed-by: Joshua Watt Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index a1dce143dd..adcfc827cf 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py @@ -235,7 +235,9 @@ def list_licenses(licensestr, d): 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):