Commit 4debbe81 authored by justcoding121's avatar justcoding121

fix object reference null error

parent 55cca706
......@@ -44,23 +44,19 @@ namespace Titanium.Web.Proxy.Network
@continue = await action(currentConnection);
}
catch (T ex)
{
await disposeConnection();
catch (Exception ex)
{
exception = ex;
}
catch
{
await disposeConnection();
throw;
}
if(exception == null)
if(exception == null
|| !(exception is T))
{
break;
}
exception = null;
await disposeConnection();
attempts--;
}
......
......@@ -267,7 +267,8 @@ namespace Titanium.Web.Proxy
//between sessions without using it.
//Do not release authenticated connections for performance reasons.
//Otherwise it will keep authenticating per session.
if (EnableConnectionPool && !connection.IsWinAuthenticated)
if (EnableConnectionPool && connection!=null
&& !connection.IsWinAuthenticated)
{
await tcpConnectionFactory.Release(connection);
connection = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment