Skip to content

Commit

Permalink
[FIXED] twice respMap nil check (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonberrutti authored Dec 17, 2024
1 parent d6eaa84 commit 074c819
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 @@ -4067,10 +4067,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 @@ -5406,9 +5402,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 074c819

Please sign in to comment.