Skip to content

Commit

Permalink
fix nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed Jan 23, 2023
1 parent 46d58f0 commit 1922bc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,10 @@ func (c *WebhookConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
if c.URL != nil && c.URLFile != "" {
return fmt.Errorf("at most one of url & url_file must be configured")
}
if c.URL.Scheme != "https" && c.URL.Scheme != "http" {
return fmt.Errorf("scheme required for webhook url")
if c.URL != nil {
if c.URL.Scheme != "https" && c.URL.Scheme != "http" {
return fmt.Errorf("scheme required for webhook url")
}
}
return nil
}
Expand Down

0 comments on commit 1922bc6

Please sign in to comment.