Skip to content

Commit f346c39

Browse files
authored
fix: already subscribe to topic (#231)
1 parent 584756b commit f346c39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conn/channel.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ func (hc *channelSession) subscribeTopic(topic string, handler func([]byte, *[]b
752752
if handler == nil {
753753
return errors.New("handler is nil")
754754
}
755-
if _, ok := hc.topicHandlers[topic]; ok {
755+
if oldHandler, ok := hc.topicHandlers[topic]; ok && oldHandler != nil {
756756
return errors.New("already subscribed to topic " + topic)
757757
}
758758
hc.topicMu.Lock()

0 commit comments

Comments
 (0)