Skip to content

Commit c327839

Browse files
authored
fix: nil pointer exception in feature stale watcher (#2167)
To resolve #2166
1 parent 8b138de commit c327839

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pkg/notification/sender/sender.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,16 @@ func (s *sender) Send(ctx context.Context, notificationEvent *senderproto.Notifi
114114
var lastErr error
115115
for _, subscription := range subscriptions {
116116
// When a flag changes it must be checked before sending notifications
117-
send := s.checkForFeatureDomainEvent(
118-
subscription,
119-
notificationEvent.SourceType,
120-
notificationEvent.Notification.DomainEventNotification.EntityData,
121-
)
122-
// Check if the subcription tag is configured in the feature flag
123-
// If not, we skip the notification
117+
send := true
118+
if notificationEvent.Notification.DomainEventNotification != nil {
119+
// If this is a feature domain event, we need to check if the subscription tag is configured in the flag
120+
// If not, we skip the notification
121+
send = s.checkForFeatureDomainEvent(
122+
subscription,
123+
notificationEvent.SourceType,
124+
notificationEvent.Notification.DomainEventNotification.EntityData,
125+
)
126+
}
124127
if !send {
125128
continue
126129
}

0 commit comments

Comments
 (0)