diff options
-rw-r--r-- | src/mongo/db/query/cost_model/cost_model_on_update.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/query/cost_model/cost_model_on_update.cpp b/src/mongo/db/query/cost_model/cost_model_on_update.cpp index c57d00b4140..c64a9385b8a 100644 --- a/src/mongo/db/query/cost_model/cost_model_on_update.cpp +++ b/src/mongo/db/query/cost_model/cost_model_on_update.cpp @@ -56,6 +56,11 @@ Status updateCostCoefficients() { const auto overrides = getCostModelCoefficientsOverride(); auto updater = onCoefficientsChangeUpdater(serviceCtx).get(); + if (!updater) { + return Status(ErrorCodes::IllegalOperation, + "failed to set 'internalCostModelCoefficients' because " + "OnCoefficientsChangeUpdater is null"); + } updater->updateCoefficients(serviceCtx, overrides); } else { // 'client' may be null if the server parameter is set on mongod startup. |