summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.h
diff options
context:
space:
mode:
authorRomans Kasperovics <romans.kasperovics@mongodb.com>2022-05-04 13:15:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-04 14:28:45 +0000
commitdee78d953c905a26e84741a5d40f8a463c594759 (patch)
tree8a16e9f96b95f6b929d7ea644cc7da5d92a3e971 /src/mongo/db/operation_context.h
parent32ea347de86eb649b5b1d196bbc4cb5411d1d26b (diff)
downloadmongo-dee78d953c905a26e84741a5d40f8a463c594759.tar.gz
SERVER-65460 Set allowDiskUse to false in read-only mode
Diffstat (limited to 'src/mongo/db/operation_context.h')
-rw-r--r--src/mongo/db/operation_context.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index ec3d01f4133..e4b522139d4 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -596,7 +596,7 @@ public:
* - User originating operations are not allowed to perform writes.
*/
bool readOnly() const {
- if (!getClient()->isFromUserConnection())
+ if (!(getClient() && getClient()->isFromUserConnection()))
return false;
return !getServiceContext()->userWritesAllowed();
}