From 7a896234aa153bf171f53d06f205ce7af89e920f Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Sun, 9 Feb 2025 00:18:35 +0500 Subject: [PATCH] fix: don't panic on multiple deletion SM patches --- api/resmap/reswrangler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/resmap/reswrangler.go b/api/resmap/reswrangler.go index 2e34fae6a7..f6443539f1 100644 --- a/api/resmap/reswrangler.go +++ b/api/resmap/reswrangler.go @@ -181,6 +181,10 @@ func (m *resWrangler) GetMatchingResourcesByAnyId( matches IdMatcher) []*resource.Resource { var result []*resource.Resource for _, r := range m.rList { + if r.RNode.IsNilOrEmpty() { + continue + } + for _, id := range append(r.PrevIds(), r.CurId()) { if matches(id) { result = append(result, r)