Skip to content

Commit

Permalink
Handle nil channel case inside router model
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Nov 16, 2023
1 parent 015f74b commit 50f211d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions broadcastclients/broadcastclients.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func (bcs *BroadcastClients) Start(ctx context.Context) {
continue
}
lastConfirmed = cs
bcs.primaryRouter.forwardConfirmationChan <- cs
if bcs.primaryRouter.forwardConfirmationChan != nil {
bcs.primaryRouter.forwardConfirmationChan <- cs
}

// Secondary Feeds
case msg := <-bcs.secondaryRouter.messageChan:
Expand All @@ -187,7 +189,9 @@ func (bcs *BroadcastClients) Start(ctx context.Context) {
continue
}
lastConfirmed = cs
bcs.secondaryRouter.forwardConfirmationChan <- cs
if bcs.secondaryRouter.forwardConfirmationChan != nil {
bcs.secondaryRouter.forwardConfirmationChan <- cs
}

// Cycle buckets to get rid of old entries
case <-recentFeedItemsCleanup.C:
Expand Down

0 comments on commit 50f211d

Please sign in to comment.