Skip to content

Commit 6f839b3

Browse files
authored
Quick fix to prevent panic on nil collector result (#1508)
* quick fix to prevent panic on nil collector result * do not save pod details on error
1 parent ebe98ff commit 6f839b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/collect/run_pod.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func (c *CollectRunPod) Collect(progressChan chan<- interface{}) (result Collect
7272
}
7373

7474
defer func() {
75+
if err != nil {
76+
return
77+
}
7578
result, err = savePodDetails(ctx, client, result, c.BundlePath, c.ClientConfig, pod, c.Collector)
7679
if err != nil {
7780
klog.Errorf("failed to save pod details: %v", err)

0 commit comments

Comments
 (0)