From 043ab2cd5902dedad0e9f743dada85dfbcb613de Mon Sep 17 00:00:00 2001
From: SagePtr <sageptr@gmail.com>
Date: Thu, 20 Sep 2018 07:49:07 +0200
Subject: [PATCH] Fix null pointer dereference in ParseCommitWithSignature
 (#4962)

---
 models/gpg_key.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/models/gpg_key.go b/models/gpg_key.go
index 45da889504..c9b57caaa6 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -360,7 +360,7 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
 
 // ParseCommitWithSignature check if signature is good against keystore.
 func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
-	if c.Signature != nil {
+	if c.Signature != nil && c.Committer != nil {
 		//Parsing signature
 		sig, err := extractSignature(c.Signature.Signature)
 		if err != nil { //Skipping failed to extract sign