Fix Github PR checks error

When a commit contained a file without patch information like an added
empty file, there was a nil pointer dereference.
This commit is contained in:
Cristhian Amaya committed 2018-11-23 11:56:49 +01:00
1 parent db08fc0564
commit 6e086c4297
2 files changed
+13

No files matched your search

+4
View File
@@ -51,6 +51,10 @@ func auditGithubPR() ([]Leak, error) {
}
files := commit.Files
for _, f := range files {
if f.Patch == nil || f.Filename == nil {
continue
}
diff := gitDiff{
sha: commit.GetSHA(),
content: *f.Patch,