Commit dad32414 authored by Marc Gravell's avatar Marc Gravell

fix possible NRE

parent e3f96fb5
...@@ -205,7 +205,7 @@ internal override void SetExceptionAndComplete(Exception exception, PhysicalBrid ...@@ -205,7 +205,7 @@ internal override void SetExceptionAndComplete(Exception exception, PhysicalBrid
{ {
for(int i = 0; i < inner.Length;i++) for(int i = 0; i < inner.Length;i++)
{ {
inner[i].Wrapped.SetExceptionAndComplete(exception, bridge); inner[i]?.Wrapped?.SetExceptionAndComplete(exception, bridge);
} }
} }
base.SetExceptionAndComplete(exception, bridge); base.SetExceptionAndComplete(exception, bridge);
...@@ -515,8 +515,12 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes ...@@ -515,8 +515,12 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
// the pending tasks // the pending tasks
foreach (var op in wrapped) foreach (var op in wrapped)
{ {
op.Wrapped.Fail(ConnectionFailureType.ProtocolFailure, null, "transaction failure"); var inner = op?.Wrapped;
bridge.CompleteSyncOrAsync(op.Wrapped); if(inner != null)
{
inner.Fail(ConnectionFailureType.ProtocolFailure, null, "transaction failure");
bridge.CompleteSyncOrAsync(inner);
}
} }
} }
return false; return false;
......
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