Check for CanInterface.

This commit is contained in:
François de Metz 2016-06-02 21:39:10 +02:00
parent c6b14833df
commit 5b90efd847
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ func (wb *Webhooks) AvailableWebhooks() []Webhook {
for i := 0; i < s.NumField(); i++ {
f := s.Field(i)
if !f.CanInterface() {
continue
}
if wbPlugin, ok := f.Interface().(Webhook); ok {
if !reflect.ValueOf(wbPlugin).IsNil() {
webhooks = append(webhooks, wbPlugin)