Skip to content

Commit 7f9fb67

Browse files
committed
If there is no destination (i.e. CommandType.Done), just skip it.
1 parent a7d8429 commit 7f9fb67

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/NetMQ/Core/IOThread.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ public void Ready()
9191
// Process all available commands.
9292
while (m_mailbox.TryRecv(out Command command))
9393
{
94-
Assumes.NotNull(command.Destination);
95-
command.Destination.ProcessCommand(command);
94+
command.Destination?.ProcessCommand(command);
9695
}
9796
}
9897

src/NetMQ/Core/Reaper.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,8 @@ public void InEvent()
126126
if (!m_mailbox.TryRecv(0, out Command command))
127127
break;
128128

129-
Assumes.NotNull(command.Destination);
130-
131129
// Process the command.
132-
command.Destination.ProcessCommand(command);
130+
command.Destination?.ProcessCommand(command);
133131
}
134132
}
135133

src/NetMQ/Core/SocketBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,7 @@ private void ProcessCommands(int timeout, bool throttle, CancellationToken cance
12611261
// Process all the commands available at the moment.
12621262
while (found)
12631263
{
1264-
Assumes.NotNull(command.Destination);
1265-
command.Destination.ProcessCommand(command);
1264+
command.Destination?.ProcessCommand(command);
12661265
found = m_mailbox.TryRecv(0, out command);
12671266
}
12681267

0 commit comments

Comments
 (0)