summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/query/planner_access.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/query/planner_access.cpp b/src/mongo/db/query/planner_access.cpp
index 6f9302ee412..c5bb27b9451 100644
--- a/src/mongo/db/query/planner_access.cpp
+++ b/src/mongo/db/query/planner_access.cpp
@@ -279,7 +279,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeCollectionScan(
if (!hint.isEmpty()) {
BSONElement natural = hint[query_request_helper::kNaturalSortField];
if (natural) {
- csn->direction = natural.numberInt() >= 0 ? 1 : -1;
+ csn->direction = natural.safeNumberInt() >= 0 ? 1 : -1;
}
}