diff --git a/src/opm/output/eclipse/AggregateConnectionData.cpp b/src/opm/output/eclipse/AggregateConnectionData.cpp index 17b674ead..0ce2f4ef4 100755 --- a/src/opm/output/eclipse/AggregateConnectionData.cpp +++ b/src/opm/output/eclipse/AggregateConnectionData.cpp @@ -323,7 +323,7 @@ captureDeclaredConnData(const Schedule& sched, it->second[connID] = &(xr->second.connections[rCInd]); rCInd+= 1; } - else if (rCInd >= xr->second.connections.size()) { + else if ((conns[connID].state() == Opm::WellCompletion::StateEnum::OPEN) && (rCInd >= xr->second.connections.size())) { throw std::invalid_argument { "Inconsistent number of open connections I in vector (" + std::to_string(xr->second.connections.size()) + ") in Well " + wl->name()