diff --git a/internal/api/connectors/sources/impl.go b/internal/api/connectors/sources/impl.go index b3a62c9a..ad9adadd 100644 --- a/internal/api/connectors/sources/impl.go +++ b/internal/api/connectors/sources/impl.go @@ -134,6 +134,10 @@ func (this *sourcesClientImpl) GetSourceConnectionDetails(ctx context.Context, s return SourceConnectionStatus{}, err } + if sourcesResponse == nil { + return SourceConnectionStatus{}, fmt.Errorf("GetSources returned an empty response") + } + source := (*sourcesResponse)[0] rhcConnectionResponse, err := this.getRHCConnectionStatus(ctx, string(*source.Id)) @@ -142,6 +146,10 @@ func (this *sourcesClientImpl) GetSourceConnectionDetails(ctx context.Context, s return SourceConnectionStatus{}, err } + if rhcConnectionResponse == nil || rhcConnectionResponse.Data == nil { + return SourceConnectionStatus{}, fmt.Errorf("GetRHCConnectionStatus returned an empty response") + } + rhcInfo := (*rhcConnectionResponse).Data return SourceConnectionStatus{