Nil pointer dereference in OnConnectionConfigChanged closes #4784 (#4829)

* Add test demonstrating bug #4784 - OnConnectionConfigChanged panics with nil pool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4784: Add nil pool check in handlePluginInstanceChanges

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Nathan Wallace
2025-11-16 00:32:47 +08:00
committed by GitHub
parent 5ee33414b7
commit d58888e2d2
2 changed files with 39 additions and 0 deletions

View File

@@ -27,6 +27,12 @@ func (m *PluginManager) handlePluginInstanceChanges(ctx context.Context, newPlug
// update connectionConfigMap
m.plugins = newPlugins
// if pool is nil, we're in a test environment or the plugin manager hasn't been fully initialized
// in this case, we can't repopulate the plugin table, so just return early
if m.pool == nil {
return nil
}
// repopulate the plugin table
conn, err := m.pool.Acquire(ctx)
if err != nil {