Skip to content

Commit

Permalink
fix problem when no responseBody is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rk authored and sladkoff committed Feb 20, 2020
1 parent 1cf58af commit 9ef5c3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,13 @@ func (b *Broker) send(rb protocolBody, promiseResponse bool, responseHeaderVersi
}

func (b *Broker) sendAndReceive(req protocolBody, res protocolBody) error {
promise, err := b.send(req, res != nil, res.headerVersion())

responseHeaderVersion := int16(-1)
if res != nil {
responseHeaderVersion = res.headerVersion()
}

promise, err := b.send(req, res != nil, responseHeaderVersion)
if err != nil {
return err
}
Expand Down

0 comments on commit 9ef5c3b

Please sign in to comment.