diff --git a/TGServiceInterface/Server.cs b/TGServiceInterface/Server.cs index 60a67df326..9078e11aec 100644 --- a/TGServiceInterface/Server.cs +++ b/TGServiceInterface/Server.cs @@ -135,7 +135,10 @@ namespace TGServiceInterface if (ChannelFactoryCache.ContainsKey(tot)) try { - return ((ChannelFactory)ChannelFactoryCache[tot]).CreateChannel(); + cf = ((ChannelFactory)ChannelFactoryCache[tot]); + if (cf.State != CommunicationState.Opened) + throw new Exception(); + return cf.CreateChannel(); } catch {