BUG: Pstream: incorrect indexing. Fixes #3452

This commit is contained in:
mattijs
2025-10-16 11:52:12 +01:00
parent e9fcd75ec4
commit 013dbb8248

View File

@ -855,7 +855,7 @@ bool Foam::UPstream::finishedRequest(const label i)
// This allows MPI to progress behind the scenes if it wishes. // This allows MPI to progress behind the scenes if it wishes.
int flag = 0; int flag = 0;
if (i < 0 || i >= PstreamGlobals::outstandingRequests_.size()) if (i >= 0 && i < PstreamGlobals::outstandingRequests_.size())
{ {
auto& request = PstreamGlobals::outstandingRequests_[i]; auto& request = PstreamGlobals::outstandingRequests_[i];