From bb09be7d0cc7db9661cfa8e7188d632d82ba41a1 Mon Sep 17 00:00:00 2001 From: Amit Schendel Date: Tue, 11 Feb 2025 12:43:23 +0000 Subject: [PATCH] Fixing panic when application profile is nil and being passed to indexing Signed-off-by: Amit Schendel --- .../applicationprofilecache/applicationprofilecache.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/objectcache/applicationprofilecache/applicationprofilecache.go b/pkg/objectcache/applicationprofilecache/applicationprofilecache.go index ee4d80ce..66eae53b 100644 --- a/pkg/objectcache/applicationprofilecache/applicationprofilecache.go +++ b/pkg/objectcache/applicationprofilecache/applicationprofilecache.go @@ -313,7 +313,11 @@ func (ap *ApplicationProfileCacheImpl) addPod(obj runtime.Object) { ap.slugToAppProfile.Set(uniqueSlug, appProfile) } - ap.indexContainerCallStacks(container, ap.containerToName.Get(container), ap.slugToAppProfile.Get(uniqueSlug)) + appProfile := ap.slugToAppProfile.Get(uniqueSlug) + state := ap.slugToState.Get(uniqueSlug) + if appProfile != nil && state.status == helpersv1.Completed { + ap.indexContainerCallStacks(container, ap.containerToName.Get(container), appProfile) + } } }