mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
* Add test for #4752: Nil pointer dereference in waitForPluginLoad This test demonstrates the bug where waitForPluginLoad() panics with a nil pointer dereference when a plugin fails during startup before the reattach config is set. The test creates a runningPlugin with reattach=nil and closes the failed channel, simulating a plugin that fails in startPluginProcess before initializePlugin is called. * Fix #4752: Add nil check for reattach in waitForPluginLoad Adds a nil pointer check before accessing p.reattach.Pid when a plugin fails during startup. If the plugin fails before the reattach config is set (e.g., in startPluginProcess), reattach will be nil and the code would previously panic when trying to log the PID. The fix checks if reattach is nil and logs an appropriate message in each case, preventing the panic while still providing useful debugging information.