Skip to content

Commit

Permalink
[FIXED] twice respMap nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonberrutti committed Dec 16, 2024
1 parent 01fafde commit f367858
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -4028,10 +4028,6 @@ func (nc *Conn) respHandler(m *Msg) {
// Helper to setup and send new request style requests. Return the chan to receive the response.
func (nc *Conn) createNewRequestAndSend(subj string, hdr, data []byte) (chan *Msg, string, error) {
nc.mu.Lock()
// Do setup for the new style if needed.
if nc.respMap == nil {
nc.initNewResp()
}
// Create new literal Inbox and map to a chan msg.
mch := make(chan *Msg, RequestChanLen)
respInbox := nc.newRespInbox()
Expand Down Expand Up @@ -5273,9 +5269,6 @@ func (nc *Conn) clearPendingFlushCalls() {
// This will clear any pending Request calls.
// Lock is assumed to be held by the caller.
func (nc *Conn) clearPendingRequestCalls() {
if nc.respMap == nil {
return
}
for key, ch := range nc.respMap {
if ch != nil {
close(ch)
Expand Down

0 comments on commit f367858

Please sign in to comment.