diff --git a/pkg/broker/ingress/ingress_handler.go b/pkg/broker/ingress/ingress_handler.go index b5dade97245..44db9e5e037 100644 --- a/pkg/broker/ingress/ingress_handler.go +++ b/pkg/broker/ingress/ingress_handler.go @@ -77,8 +77,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve brokerInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - broker, ok := obj.(eventingv1.Broker) - if !ok { + broker, ok := obj.(*eventingv1.Broker) + if !ok || broker == nil || broker.Status.Address == nil { return } kncloudevents.AddOrUpdateAddressableHandler(duckv1.Addressable{ @@ -87,8 +87,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve }) }, UpdateFunc: func(_, obj interface{}) { - broker, ok := obj.(eventingv1.Broker) - if !ok { + broker, ok := obj.(*eventingv1.Broker) + if !ok || broker == nil || broker.Status.Address == nil { return } kncloudevents.AddOrUpdateAddressableHandler(duckv1.Addressable{ @@ -97,8 +97,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve }) }, DeleteFunc: func(obj interface{}) { - broker, ok := obj.(eventingv1.Broker) - if !ok { + broker, ok := obj.(*eventingv1.Broker) + if !ok || broker == nil || broker.Status.Address == nil { return } kncloudevents.DeleteAddressableHandler(duckv1.Addressable{