Files
steampipe/pkg/pluginmanager_service
Nathan Wallace 55e2d407a0 Fix #4783: Nil pointer dereference in updateConnectionSchema (#4901)
* Add test demonstrating bug #4783 - updateConnectionSchema with nil pool

This test verifies that updateConnectionSchema handles a nil pool gracefully.
While RefreshConnections (via newRefreshConnectionState) already checks for
nil pool since #4778, this test demonstrates that updateConnectionSchema
should perform an early nil check for better error handling.

The test currently passes because newRefreshConnectionState catches the nil
pool, but we should add an explicit check at the start of updateConnectionSchema
for clarity and to avoid unnecessary work.

Related to issue #4783

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

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

* Fix #4783: Add nil pool check in updateConnectionSchema

Add an early nil check for the pool at the beginning of updateConnectionSchema
to prevent unnecessary work and provide clearer error handling.

While newRefreshConnectionState (called by RefreshConnections) already checks
for nil pool since #4778, adding the check at the start of updateConnectionSchema
provides several benefits:

1. Avoids unnecessary work - we don't call RefreshConnections if pool is nil
2. Clearer error logging - warning message specifically indicates the issue
   is in updateConnectionSchema
3. Defense in depth - validates preconditions before executing the method

The method is called from the message server when a plugin sends a schema
update notification, so the nil check ensures we handle edge cases gracefully.

Closes #4783

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-17 04:00:18 -05:00
..