From 93d3eaf0b5026f003fcc071ba9596d9d225e9b17 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 10 Sep 2023 12:06:06 +0200 Subject: [PATCH] [F3] the closed date of an issue may be nil --- go.mod | 2 +- go.sum | 4 ++-- services/f3/driver/issue.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7140d7f8c9..c26f493d3b 100644 --- a/go.mod +++ b/go.mod @@ -118,7 +118,7 @@ require ( gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v3 v3.0.1 - lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230909181317-1e49a01bb3b7 + lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230910085839-f7303be2bb53 mvdan.cc/xurls/v2 v2.5.0 strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 xorm.io/builder v0.3.13 diff --git a/go.sum b/go.sum index 926e37ddf7..09040e070a 100644 --- a/go.sum +++ b/go.sum @@ -1596,8 +1596,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230909181317-1e49a01bb3b7 h1:7/4APz7dLeZ51rBxBQjwCpZBmJeOEhLIQfkuVQilN4g= -lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230909181317-1e49a01bb3b7/go.mod h1:TcKaEsgVihjAjw290iDvvirCT0P+DZNpzc0ZgNgy3E4= +lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230910085839-f7303be2bb53 h1:nFUsYBuqzmXx7nIxGjcU8J1i++7G2P8Rs1fl2TGPjHI= +lab.forgefriends.org/friendlyforgeformat/gof3 v1.0.1-0.20230910085839-f7303be2bb53/go.mod h1:TcKaEsgVihjAjw290iDvvirCT0P+DZNpzc0ZgNgy3E4= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= diff --git a/services/f3/driver/issue.go b/services/f3/driver/issue.go index dbcb3bab14..33657feccd 100644 --- a/services/f3/driver/issue.go +++ b/services/f3/driver/issue.go @@ -116,12 +116,15 @@ func (o *Issue) FromFormat(issue *format.Issue) { IsClosed: issue.State == "closed", CreatedUnix: timeutil.TimeStamp(issue.Created.Unix()), UpdatedUnix: timeutil.TimeStamp(issue.Updated.Unix()), - ClosedUnix: timeutil.TimeStamp(issue.Closed.Unix()), IsLocked: issue.IsLocked, Labels: labels, Assignees: assignees, }, } + + if issue.Closed != nil { + o.ClosedUnix = timeutil.TimeStamp(issue.Closed.Unix()) + } } type IssueProvider struct {