Skip to content

Commit

Permalink
nil safety
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Feb 1, 2024
1 parent 3f761d1 commit 13d1549
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions relayer/processor/types_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ func (c *packetMessageSendCache) set(sequence uint64) {
func (c packetChannelMessageCache) deleteMessages(toDelete ...map[string][]uint64) {
for _, toDeleteMap := range toDelete {
for message, toDeleteMessages := range toDeleteMap {
if _, ok := c[message]; !ok {
continue
}
c[message].mu.Lock()
for _, sequence := range toDeleteMessages {
delete(c[message].m, sequence)
Expand Down Expand Up @@ -417,6 +420,9 @@ func (c *channelKeySendCache) set(key ChannelKey) {
func (c channelProcessingCache) deleteMessages(toDelete ...map[string][]ChannelKey) {
for _, toDeleteMap := range toDelete {
for message, toDeleteMessages := range toDeleteMap {
if _, ok := c[message]; !ok {
continue
}
c[message].mu.Lock()
for _, channel := range toDeleteMessages {
delete(c[message].m, channel)
Expand Down Expand Up @@ -453,6 +459,9 @@ func (c *connectionKeySendCache) set(key ConnectionKey) {
func (c connectionProcessingCache) deleteMessages(toDelete ...map[string][]ConnectionKey) {
for _, toDeleteMap := range toDelete {
for message, toDeleteMessages := range toDeleteMap {
if _, ok := c[message]; !ok {
continue
}
c[message].mu.Lock()
for _, connection := range toDeleteMessages {
delete(c[message].m, connection)
Expand Down

0 comments on commit 13d1549

Please sign in to comment.