summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-08-27 14:26:01 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-08-27 14:26:27 -0400
commit402fa5cc4a5f74cd7e592d9273a94e7cf25446b6 (patch)
tree9e8d3927df8a59224b027111c1ef26e7692368be /src
parent57d007e00124d18e94c204e3968b53f83c01f1b7 (diff)
downloadmongo-402fa5cc4a5f74cd7e592d9273a94e7cf25446b6.tar.gz
SERVER-36474 Cannot initiate a replica set if free monitoring is disabled at command-line
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/free_mon/free_mon_mongod.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/free_mon/free_mon_mongod.cpp b/src/mongo/db/free_mon/free_mon_mongod.cpp
index 112136fe8ca..f4a9c67cadb 100644
--- a/src/mongo/db/free_mon/free_mon_mongod.cpp
+++ b/src/mongo/db/free_mon/free_mon_mongod.cpp
@@ -386,7 +386,11 @@ void stopFreeMonitoring() {
}
void notifyFreeMonitoringOnTransitionToPrimary() {
- FreeMonController::get(getGlobalServiceContext())->notifyOnTransitionToPrimary();
+ auto controller = FreeMonController::get(getGlobalServiceContext());
+
+ if (controller != nullptr) {
+ controller->notifyOnTransitionToPrimary();
+ }
}
void setupFreeMonitoringOpObserver(OpObserverRegistry* registry) {