Details
Description
In this commit, a few lines were refactored into a local lambda function, but the check here was not ported over:
https://github.com/mongodb/mongo/commit/09919208ae16cd44f3ca3e98220e1cc322419a8a#diff-64f8569158f82fc1a18681d15ce10b4aL651
This can lead to issues when trying to process the command further.