Skip to content

Commit 89eaaba

Browse files
kjnilssonmichaelklishin
authored andcommitted
fix null ref exception that didn't manifest itself until test were run by fake
1 parent 5ebd32a commit 89eaaba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

projects/client/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ public void Close()
244244
}
245245

246246
m_queueCts.Cancel(true);
247-
m_queue.Dispose();
248-
m_queue = null;
247+
if(m_queue != null)
248+
{
249+
m_queue.Dispose();
250+
m_queue = null;
251+
}
249252
#if NETFX_CORE || NET4
250253
var exn = new EndOfStreamException("Subscription closed");
251254
foreach (var tsc in m_waiting)

0 commit comments

Comments
 (0)