From 8853e10035acc7c055e1db026aab981f220f557a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Thu, 26 Sep 2024 17:56:54 +0400 Subject: [PATCH] fix nil deref in source init --- v2/pkg/passive/sources.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v2/pkg/passive/sources.go b/v2/pkg/passive/sources.go index db569fdf6..03ff7bdce 100644 --- a/v2/pkg/passive/sources.go +++ b/v2/pkg/passive/sources.go @@ -156,6 +156,10 @@ func New(sourceNames, excludedSourceNames []string, useAllSources, useSourcesSup } } + if len(sources) == 0 { + gologger.Fatal().Msg("No sources selected for this search") + } + gologger.Debug().Msgf("Selected source(s) for this search: %s", strings.Join(maps.Keys(sources), ", ")) for _, currentSource := range sources {