From e32522b8ed309916c5595d8e1203d7fce8f415d6 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 19 Sep 2023 15:27:12 +0200 Subject: [PATCH] fix(plugins/gcpaudit): check open params. Signed-off-by: Federico Di Pierro --- plugins/gcpaudit/pkg/gcpaudit/gcpaudit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/gcpaudit/pkg/gcpaudit/gcpaudit.go b/plugins/gcpaudit/pkg/gcpaudit/gcpaudit.go index 69a90287..0a154773 100644 --- a/plugins/gcpaudit/pkg/gcpaudit/gcpaudit.go +++ b/plugins/gcpaudit/pkg/gcpaudit/gcpaudit.go @@ -28,6 +28,10 @@ func (p *Plugin) Info() *plugins.Info { } func (p *Plugin) Open(params string) (source.Instance, error) { + if params == "" { + return nil, fmt.Errorf("no subscriptionID provided") + } + subscriptionID := params ctx, cancel := context.WithCancel(context.Background()) eventsC, errC := p.pullMsgsSync(ctx, subscriptionID)