Skip to content

Commit eabf727

Browse files
authored
Merge pull request #185 from msanatan/fix-on-focus-config-check
Fix on focus config check
2 parents bc16ca6 + 2b69eb1 commit eabf727

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ private void OnEnable()
5858

5959
private void OnFocus()
6060
{
61-
// Refresh configuration status when window gains focus
62-
foreach (McpClient mcpClient in mcpClients.clients)
61+
if (mcpClients.clients.Count > 0 && selectedClientIndex < mcpClients.clients.Count)
6362
{
64-
CheckMcpConfiguration(mcpClient);
63+
McpClient selectedClient = mcpClients.clients[selectedClientIndex];
64+
CheckMcpConfiguration(selectedClient);
6565
}
6666
Repaint();
6767
}

0 commit comments

Comments
 (0)