aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/convert
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/convert')
-rw-r--r--routers/api/v1/convert/convert.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/routers/api/v1/convert/convert.go b/routers/api/v1/convert/convert.go
index 153993ce82..0a0ab364bd 100644
--- a/routers/api/v1/convert/convert.go
+++ b/routers/api/v1/convert/convert.go
@@ -45,6 +45,11 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
committerUsername = committer.Name
}
verif := models.ParseCommitWithSignature(c)
+ var signature, payload string
+ if c.Signature != nil {
+ signature = c.Signature.Signature
+ payload = c.Signature.Payload
+ }
return &api.PayloadCommit{
ID: c.ID.String(),
Message: c.Message(),
@@ -63,8 +68,8 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
Verification: &api.PayloadCommitVerification{
Verified: verif.Verified,
Reason: verif.Reason,
- Signature: c.Signature.Signature,
- Payload: c.Signature.Payload,
+ Signature: signature,
+ Payload: payload,
},
}
}