mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
@@ -46,6 +46,10 @@ func NewInitData() *InitData {
|
|||||||
|
|
||||||
func (i *InitData) RegisterExporters(exporters ...export.Exporter) *InitData {
|
func (i *InitData) RegisterExporters(exporters ...export.Exporter) *InitData {
|
||||||
for _, e := range exporters {
|
for _, e := range exporters {
|
||||||
|
// Skip nil exporters to prevent nil pointer panic
|
||||||
|
if e == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := i.ExportManager.Register(e); err != nil {
|
if err := i.ExportManager.Register(e); err != nil {
|
||||||
// short circuit if there is an error
|
// short circuit if there is an error
|
||||||
i.Result.Error = err
|
i.Result.Error = err
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ func TestInitData_CleanupIdempotency(t *testing.T) {
|
|||||||
|
|
||||||
// TestInitData_NilExporter tests registering nil exporters
|
// TestInitData_NilExporter tests registering nil exporters
|
||||||
func TestInitData_NilExporter(t *testing.T) {
|
func TestInitData_NilExporter(t *testing.T) {
|
||||||
t.Skip("Demonstrates bug #4750 - HIGH nil pointer panic when registering nil exporter. Remove this skip in bug fix PR commit 1, then fix in commit 2.")
|
// t.Skip("Demonstrates bug #4750 - HIGH nil pointer panic when registering nil exporter. Remove this skip in bug fix PR commit 1, then fix in commit 2.")
|
||||||
initData := NewInitData()
|
initData := NewInitData()
|
||||||
|
|
||||||
// Register nil exporter - should this panic or handle gracefully?
|
// Register nil exporter - should this panic or handle gracefully?
|
||||||
|
|||||||
Reference in New Issue
Block a user