File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
projects/client/RabbitMQ.Client/src/client/messagepatterns Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,11 @@ public void Close()
157
157
}
158
158
159
159
if ( shouldCancelConsumer ) {
160
- m_model . BasicCancel ( m_consumerTag ) ;
160
+ if ( m_model . IsOpen )
161
+ {
162
+ m_model . BasicCancel ( m_consumerTag ) ;
163
+ }
164
+
161
165
m_consumerTag = null ;
162
166
}
163
167
} catch ( OperationInterruptedException ) {
@@ -190,7 +194,7 @@ public void Ack(BasicDeliverEventArgs evt)
190
194
191
195
lock ( m_eventLock )
192
196
{
193
- if ( ! m_noAck ) {
197
+ if ( ! m_noAck && m_model . IsOpen ) {
194
198
m_model . BasicAck ( evt . DeliveryTag , false ) ;
195
199
}
196
200
@@ -236,7 +240,7 @@ public void Nack(BasicDeliverEventArgs evt,
236
240
237
241
lock ( m_eventLock )
238
242
{
239
- if ( ! m_noAck ) {
243
+ if ( ! m_noAck && m_model . IsOpen ) {
240
244
m_model . BasicNack ( evt . DeliveryTag , multiple , requeue ) ;
241
245
}
242
246
You can’t perform that action at this time.
0 commit comments