Fix nil pointer check

This commit is contained in:
Zoltán Papp
2025-11-12 13:36:32 +01:00
parent c8bc865f2f
commit 6898e57686

View File

@@ -440,8 +440,12 @@ func (s *serviceClient) collectDebugData(
var postUpStatusOutput string
if postUpStatus != nil {
overview := nbstatus.ConvertToStatusOutputOverview(postUpStatus.GetFullStatus(), params.anonymize, postUpStatus.GetDaemonVersion(), "", nil, nil, nil, "", profName)
postUpStatusOutput = nbstatus.ParseToFullDetailSummary(overview)
if full := postUpStatus.GetFullStatus(); full != nil {
overview := nbstatus.ConvertToStatusOutputOverview(full, params.anonymize, postUpStatus.GetDaemonVersion(), "", nil, nil, nil, "", profName)
postUpStatusOutput = nbstatus.ParseToFullDetailSummary(overview)
} else {
log.Warn("debug bundle: daemon response missing FullStatus after post-up")
}
}
headerPostUp := fmt.Sprintf("----- NetBird post-up - Timestamp: %s", time.Now().Format(time.RFC3339))
statusOutput := fmt.Sprintf("%s\n%s", headerPostUp, postUpStatusOutput)
@@ -457,8 +461,12 @@ func (s *serviceClient) collectDebugData(
var preDownStatusOutput string
if preDownStatus != nil {
overview := nbstatus.ConvertToStatusOutputOverview(preDownStatus.GetFullStatus(), params.anonymize, preDownStatus.GetDaemonVersion(), "", nil, nil, nil, "", profName)
preDownStatusOutput = nbstatus.ParseToFullDetailSummary(overview)
if full := preDownStatus.GetFullStatus(); full != nil {
overview := nbstatus.ConvertToStatusOutputOverview(full, params.anonymize, preDownStatus.GetDaemonVersion(), "", nil, nil, nil, "", profName)
preDownStatusOutput = nbstatus.ParseToFullDetailSummary(overview)
} else {
log.Warn("debug bundle: daemon response missing FullStatus after pre-down")
}
}
headerPreDown := fmt.Sprintf("----- NetBird pre-down - Timestamp: %s - Duration: %s",
time.Now().Format(time.RFC3339), params.duration)