From 27a89ef3145e9e2547b5610b6dd39861fe8fe515 Mon Sep 17 00:00:00 2001 From: Zvika Badalov Date: Fri, 31 Oct 2025 12:00:09 -0400 Subject: [PATCH] fix: add nil check for PublishedAt in release converter to prevent panic The recent commit 794f8efcd added a SQL filter to exclude draft releases (published_at IS NOT NULL) but failed to add a defensive nil check before dereferencing the PublishedAt pointer in the converter function. This caused runtime panics when processing certain releases where the PublishedAt field was unexpectedly nil, despite the SQL filter. This fix adds a nil check that safely skips releases with nil PublishedAt, maintaining the original intent of excluding draft releases while preventing the panic. Fixes: crash in ConvertRelease at release_convertor.go:79 Related: 794f8efcd (fix: drafting releases should not be converted to domain layer) Signed-off-by: Zvika Badalov --- backend/plugins/github/tasks/release_convertor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/plugins/github/tasks/release_convertor.go b/backend/plugins/github/tasks/release_convertor.go index be49141eb5d..b5c70181fce 100644 --- a/backend/plugins/github/tasks/release_convertor.go +++ b/backend/plugins/github/tasks/release_convertor.go @@ -72,6 +72,10 @@ func ConvertRelease(taskCtx plugin.SubTaskContext) errors.Error { RawDataSubTaskArgs: *rawDataSubTaskArgs, Convert: func(inputRow interface{}) ([]interface{}, errors.Error) { githubRelease := inputRow.(*models.GithubRelease) + // Skip releases with nil PublishedAt (draft releases or data inconsistency) + if githubRelease.PublishedAt == nil { + return nil, nil + } release := &devops.CicdRelease{ DomainEntity: domainlayer.DomainEntity{ Id: releaseIdGen.Generate(githubRelease.ConnectionId, githubRelease.Id),