File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ async def _handler_wrapper(
495495 uri = original_kwargs .get ("uri" )
496496
497497 protocol = None
498- if hasattr (uri , "scheme" ):
498+ if uri is not None and hasattr (uri , "scheme" ):
499499 protocol = uri .scheme
500500 elif handler_name and "://" in handler_name :
501501 protocol = handler_name .split ("://" )[0 ]
@@ -638,7 +638,7 @@ def _patch_fastmcp() -> None:
638638 This function patches the _get_prompt_mcp and _read_resource_mcp methods
639639 to add instrumentation for those handlers.
640640 """
641- if hasattr (FastMCP , "_get_prompt_mcp" ):
641+ if FastMCP is not None and hasattr (FastMCP , "_get_prompt_mcp" ):
642642 original_get_prompt_mcp = FastMCP ._get_prompt_mcp
643643
644644 @wraps (original_get_prompt_mcp )
@@ -655,7 +655,7 @@ async def patched_get_prompt_mcp(
655655
656656 FastMCP ._get_prompt_mcp = patched_get_prompt_mcp
657657
658- if hasattr (FastMCP , "_read_resource_mcp" ):
658+ if FastMCP is not None and hasattr (FastMCP , "_read_resource_mcp" ):
659659 original_read_resource_mcp = FastMCP ._read_resource_mcp
660660
661661 @wraps (original_read_resource_mcp )
You can’t perform that action at this time.
0 commit comments