From: JamJar00 Date: Sun, 1 May 2016 22:50:08 +0000 (+0100) Subject: Added exception catch X-Git-Tag: 1.0.0~163 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=4716af0edb613907b3260bc9a93d7e0b28377a37;p=rhonda%2Fimpostor.hazel.git Added exception catch --- diff --git a/Hazel/UdpClientConnection.cs b/Hazel/UdpClientConnection.cs index b5516c4..000e803 100644 --- a/Hazel/UdpClientConnection.cs +++ b/Hazel/UdpClientConnection.cs @@ -188,6 +188,10 @@ namespace Hazel { HandleDisconnect(new HazelException("A Socket exception occured while initiating a receive operation.", e)); } + catch (ObjectDisposedException) + { + throw new HazelException("Could not begin read as the socket has been disposed of."); + } if (buffer != null) InvokeDataReceived(new DataEventArgs(buffer, sendOption));