Skip to content

Commit

Permalink
Fix nil pointer error when no target url
Browse files Browse the repository at this point in the history
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
  • Loading branch information
seemethere committed Apr 2, 2018
1 parent b47a1ed commit 2b42b9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ func createGithubClient(integrationID, installationID int, keyfile string) *gith

func handleStatus(integrationID int, keyfile string, statusEvent github.StatusEvent) {
if *statusEvent.State != "success" {
log.Debugf("Skipping unsuccessful commit status event %s", *statusEvent.TargetURL)
url := ""
if statusEvent.TargetURL != nil {
url = *statusEvent.TargetURL
}
log.Debugf("Skipping unsuccessful commit status event", url)
return
}
client := createGithubClient(integrationID, int(*statusEvent.Installation.ID), keyfile)
Expand Down

0 comments on commit 2b42b9c

Please sign in to comment.