diff --git a/grype/db/v4/store/store.go b/grype/db/v4/store/store.go index e51281a4..bcdb1aca 100644 --- a/grype/db/v4/store/store.go +++ b/grype/db/v4/store/store.go @@ -265,8 +265,8 @@ func (s *store) AddVulnerabilityMatchExclusion(exclusions ...v4.VulnerabilityMat func (s *store) Close() { s.db.Exec("VACUUM;") - sqlDB, err := s.db.DB() - if err != nil { + sqlDB, _ := s.db.DB() + if sqlDB != nil { _ = sqlDB.Close() } } diff --git a/grype/db/v5/store/store.go b/grype/db/v5/store/store.go index 9a2c882d..3c7696ad 100644 --- a/grype/db/v5/store/store.go +++ b/grype/db/v5/store/store.go @@ -289,8 +289,8 @@ func (s *store) AddVulnerabilityMatchExclusion(exclusions ...v5.VulnerabilityMat func (s *store) Close() { s.db.Exec("VACUUM;") - sqlDB, err := s.db.DB() - if err != nil { + sqlDB, _ := s.db.DB() + if sqlDB != nil { _ = sqlDB.Close() } }