summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2020-12-03 22:34:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-04 02:59:45 +0000
commit4d32e2bf75963c5ff5d4cdeb98554fb654c0d1de (patch)
tree042039ae18a07041df83baaf1dda46a0b4c9ffde /src/mongo/db
parent07582b2f254385c5c86cdc70160e18718e6f5306 (diff)
downloadmongo-4d32e2bf75963c5ff5d4cdeb98554fb654c0d1de.tar.gz
SERVER-53115 check client before dereferencing
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/curop.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index c678235e633..71facbb02cb 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -967,10 +967,12 @@ void OpDebug::report(OperationContext* opCtx,
pAttrs->addDeepCopy("ns", curop.getNS());
- if (auto clientMetadata = ClientMetadata::get(client)) {
- StringData appName = clientMetadata->getApplicationName();
- if (!appName.empty()) {
- pAttrs->add("appName", appName);
+ if (client) {
+ if (auto clientMetadata = ClientMetadata::get(client)) {
+ StringData appName = clientMetadata->getApplicationName();
+ if (!appName.empty()) {
+ pAttrs->add("appName", appName);
+ }
}
}