Skip to content

Commit 4afce88

Browse files
authored
Merge pull request #20 from grisu48/rabbitmq
Fix SIGSEGV in receive
2 parents 8ca7dfa + 2480b2b commit 4afce88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rabbitmq.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (sub *RabbitMQSubscription) Receive() (amqp.Delivery, error) {
111111
return msg, nil
112112
}
113113
}
114-
if sub.mq.closed || sub.con.IsClosed() {
114+
if sub.mq == nil || sub.mq.closed || sub.con == nil || sub.con.IsClosed() {
115115
return amqp.Delivery{}, fmt.Errorf("EOF")
116116
}
117117
return amqp.Delivery{}, fmt.Errorf("channel unexpectedly closed")

0 commit comments

Comments
 (0)