From 7f698c89346acb5e5116736d25325a046652ba81 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 28 Jun 2023 08:56:35 +0200 Subject: Don't panic on invalid security whitelist regexp Fixes #11176 --- hugolib/testhelpers_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hugolib/testhelpers_test.go') diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go index e1fd537a8..73920bd49 100644 --- a/hugolib/testhelpers_test.go +++ b/hugolib/testhelpers_test.go @@ -834,7 +834,9 @@ func (s *sitesBuilder) GetPageRel(p page.Page, ref string) page.Page { func (s *sitesBuilder) NpmInstall() hexec.Runner { sc := security.DefaultConfig - sc.Exec.Allow = security.NewWhitelist("npm") + var err error + sc.Exec.Allow, err = security.NewWhitelist("npm") + s.Assert(err, qt.IsNil) ex := hexec.New(sc) command, err := ex.New("npm", "install") s.Assert(err, qt.IsNil) -- cgit v1.2.3