From 085fe68febf762fecb1c76e084a0386507999fac Mon Sep 17 00:00:00 2001 From: Elad Zelingher <dark_leizar@walla.com> Date: Mon, 24 Aug 2015 12:41:14 +0300 Subject: [PATCH] Check disposable isn't null before disposing it --- src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs b/src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs index 7c2a39e43..597ed7f06 100644 --- a/src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs +++ b/src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs @@ -199,8 +199,11 @@ public void Unsubscribe(IUnsubscribeRequest<TMessage> request) public void Dispose() { - SubscriptionDisposable.Dispose(); - SubscriptionDisposable = null; + if (SubscriptionDisposable != null) + { + SubscriptionDisposable.Dispose(); + SubscriptionDisposable = null; + } } #endregion