mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-08 16:45:30 +00:00
Handle parsed hooks that should be ignored (#2243)
Currently it would fail with panic: ``` runtime error: invalid memory address or nil pointer dereference ... /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/forge/gitea/gitea.go:492 (0xdfb32e) ```
This commit is contained in:
parent
55e98a186a
commit
a58e3b9e06
1 changed files with 1 additions and 1 deletions
|
@ -489,7 +489,7 @@ func (c *Gitea) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
if pipeline.Event == model.EventPull && len(pipeline.ChangedFiles) == 0 {
|
||||
if pipeline != nil && pipeline.Event == model.EventPull && len(pipeline.ChangedFiles) == 0 {
|
||||
index, err := strconv.ParseInt(strings.Split(pipeline.Ref, "/")[2], 10, 64)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
Loading…
Reference in a new issue