diff --git a/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs b/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs index c61d7579..2cabfdc2 100644 --- a/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs +++ b/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs @@ -122,7 +122,7 @@ public bool RecvPipe(ref Msg msg, [NotNullWhen(returnValue: true)] out Pipe? pip m_more = msg.HasMore; if (!m_more) - m_current = (m_current + 1) % m_active; + m_current = m_active > 0 ? (m_current + 1) % m_active : 0; return true; }