Only join threads if they were made in the first place

This commit is contained in:
RogueException
2015-10-12 00:33:41 -03:00
parent a580f371c4
commit f25d35150d

View File

@@ -167,8 +167,10 @@ namespace Discord.WebSockets.Voice
protected override Task Cleanup()
{
#if USE_THREAD
_sendThread.Join();
_receiveThread.Join();
if (_sendThread != null)
_sendThread.Join();
if (_receiveThread != null)
_receiveThread.Join();
_sendThread = null;
_receiveThread = null;
#endif