From e8ba470357145a50099924abb2940d3abea7b16b Mon Sep 17 00:00:00 2001 From: solarin Date: Sun, 5 Apr 2020 16:20:09 +0400 Subject: [PATCH] IsConnected now includes a check on sender==null. Otherwise callls to this method always return True and if(!TelegramClient.IsConnected) TelegramClient.ConnectAsync() wouldn't have the expected result. --- TLSharp.Core/TelegramClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index 46e0ad4..a8ead0b 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -436,7 +436,7 @@ namespace TLSharp.Core { get { - if (transport == null) + if (transport == null || sender == null) return false; return transport.IsConnected; }