From 1ffaa04f09cb3eb9f626df82d909a662826924ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 2 Dec 2025 10:05:04 +0100 Subject: [PATCH] chore: add a check for None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit route.methods can be None so let's check for that to make mypy happy :) Signed-off-by: Sébastien Han --- src/llama_stack/core/inspect.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/llama_stack/core/inspect.py b/src/llama_stack/core/inspect.py index 45cab2970..939bc1fa3 100644 --- a/src/llama_stack/core/inspect.py +++ b/src/llama_stack/core/inspect.py @@ -100,13 +100,16 @@ class DistributionInspectImpl(Inspect): router_routes = get_router_routes(router) for route in router_routes: if _should_include_router_route(route, router.prefix): - ret.append( - RouteInfo( - route=route.path, - method=next(iter([m for m in route.methods if m != "HEAD"])), - provider_types=_get_provider_types(api), - ) - ) + 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=available_methods[0], + provider_types=_get_provider_types(api), + ) + ) # Process routes from legacy webmethod-based APIs for api, endpoints in all_endpoints.items():