Problem
AutoSetupIntegration assumes a regenerated config-client list still contains the clicked client kind and uses First(...), which throws if the item is absent.
Evidence
Editor/MCPServerWindow.Integrations.cs:96-110 receives a previously rendered client.
- It redeploys the bridge, then calls
NexusMcpConfigGenerator.BuildAllForCurrentProject().First(item => item.Kind == client.Kind).
- If the regenerated list changes shape,
First throws InvalidOperationException before the method can report a friendly setup failure.
Impact
A transient PATH/filesystem condition or future conditional client filtering can make the Auto Setup button handler crash instead of showing the user a clear failure message.
Suggested fix
Use FirstOrDefault, check for null, and surface a friendly integration message when the client kind is no longer available. Ideally avoid rebuilding the list unless needed.
Source report
Imported from audit report item: correctness (11) / Editor/MCPServerWindow.Integrations.cs:110.
Problem
AutoSetupIntegrationassumes a regenerated config-client list still contains the clicked client kind and usesFirst(...), which throws if the item is absent.Evidence
Editor/MCPServerWindow.Integrations.cs:96-110receives a previously renderedclient.NexusMcpConfigGenerator.BuildAllForCurrentProject().First(item => item.Kind == client.Kind).FirstthrowsInvalidOperationExceptionbefore the method can report a friendly setup failure.Impact
A transient PATH/filesystem condition or future conditional client filtering can make the Auto Setup button handler crash instead of showing the user a clear failure message.
Suggested fix
Use
FirstOrDefault, check for null, and surface a friendly integration message when the client kind is no longer available. Ideally avoid rebuilding the list unless needed.Source report
Imported from audit report item:
correctness (11)/Editor/MCPServerWindow.Integrations.cs:110.