Skip to content

Commit 0799739

Browse files
Add assert
1 parent 867577d commit 0799739

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/MICore/Debugger.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,13 @@ private async void PostCommand(string cmd)
16191619

16201620
private void SendToTransport(string cmd)
16211621
{
1622-
ITransport transport = _transport ?? throw new InvalidOperationException();
1622+
ITransport transport = _transport;
1623+
if (transport is null)
1624+
{
1625+
Debug.Fail("Invalid: `SendToTransport` called before `Init`");
1626+
throw new InvalidOperationException();
1627+
}
1628+
16231629
transport.Send(cmd);
16241630

16251631
// https://github.com/Microsoft/MIEngine/issues/616 :

0 commit comments

Comments
 (0)