Skip to content

Commit 085fe68

Browse files
author
Elad Zelingher
committed
Check disposable isn't null before disposing it
1 parent 4a13d85 commit 085fe68

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/net45/WampSharp/WAMP2/V2/PubSub/WampRawTopic.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@ public void Unsubscribe(IUnsubscribeRequest<TMessage> request)
199199

200200
public void Dispose()
201201
{
202-
SubscriptionDisposable.Dispose();
203-
SubscriptionDisposable = null;
202+
if (SubscriptionDisposable != null)
203+
{
204+
SubscriptionDisposable.Dispose();
205+
SubscriptionDisposable = null;
206+
}
204207
}
205208

206209
#endregion

0 commit comments

Comments
 (0)