From 1c534f9d5a2318a88378f7b503437554d653fc93 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 9 Jul 2025 11:46:32 -0700 Subject: [PATCH] Fix a null-reference exception bug when built-in tools are not available --- shell/AIShell.Kernel/MCP/McpManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/AIShell.Kernel/MCP/McpManager.cs b/shell/AIShell.Kernel/MCP/McpManager.cs index 1eef9d3..626bcb7 100644 --- a/shell/AIShell.Kernel/MCP/McpManager.cs +++ b/shell/AIShell.Kernel/MCP/McpManager.cs @@ -81,7 +81,7 @@ internal async Task> ListAvailableTools() await _initTask; List tools = null; - if (_builtInTools.Count > 0) + if (_builtInTools is { Count: > 0 }) { (tools ??= []).AddRange(_builtInTools.Values); }