@@ -556,7 +556,7 @@ async def initialize_runtime_config(app: FastAPI):
556556
557557 for tool_server_connection in connections :
558558 if tool_server_connection .get ('type' , 'openapi' ) == 'mcp' :
559- server_id = tool_server_connection .get ('info' , {}).get ('id' )
559+ server_id = ( tool_server_connection .get ('info' ) or {}).get ('id' )
560560 auth_type = tool_server_connection .get ('auth_type' , 'none' )
561561
562562 if server_id and auth_type in ('oauth_2.1' , 'oauth_2.1_static' ):
@@ -2257,7 +2257,7 @@ async def register_client(request, client_id: str) -> bool:
22572257 tool_server_connections = await Config .get ('tool_server.connections' , []) or []
22582258 for idx , conn in enumerate (tool_server_connections ):
22592259 if conn .get ('type' , 'openapi' ) == server_type :
2260- info = conn .get ('info' , {})
2260+ info = conn .get ('info' ) or {}
22612261 if info .get ('id' ) == server_id :
22622262 connection = conn
22632263 connection_idx = idx
@@ -2275,7 +2275,7 @@ async def register_client(request, client_id: str) -> bool:
22752275 try :
22762276 if auth_type == 'oauth_2.1_static' :
22772277 # Static credentials: rebuild from admin-provided credentials + fresh metadata
2278- info = connection .get ('info' , {})
2278+ info = connection .get ('info' ) or {}
22792279 oauth_client_id = info .get ('oauth_client_id' ) or ''
22802280 oauth_client_secret = info .get ('oauth_client_secret' ) or ''
22812281 if not oauth_client_id or not oauth_client_secret :
@@ -2312,7 +2312,7 @@ async def register_client(request, client_id: str) -> bool:
23122312 connections [connection_idx ] = {
23132313 ** connection ,
23142314 'info' : {
2315- ** connection .get ('info' , {}),
2315+ ** ( connection .get ('info' ) or {}),
23162316 'oauth_client_info' : encrypt_data (oauth_client_info .model_dump (mode = 'json' )),
23172317 },
23182318 }
0 commit comments