chore: add a check for None

route.methods can be None so let's check for that to make mypy happy :)

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-12-02 10:05:04 +01:00
parent 3ce509e94a
commit 1ffaa04f09
No known key found for this signature in database

View file

@ -100,10 +100,13 @@ class DistributionInspectImpl(Inspect):
router_routes = get_router_routes(router)
for route in router_routes:
if _should_include_router_route(route, router.prefix):
if route.methods is not None:
available_methods = [m for m in route.methods if m != "HEAD"]
if available_methods:
ret.append(
RouteInfo(
route=route.path,
method=next(iter([m for m in route.methods if m != "HEAD"])),
method=available_methods[0],
provider_types=_get_provider_types(api),
)
)