0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

[SERVER-1992]: check if currentClient is 0, which can happen in mongos

This commit is contained in:
agirbal 2011-01-11 13:06:13 -08:00
parent 7c3be2b805
commit 2560f2c291

View File

@ -649,8 +649,8 @@ namespace mongo {
changeID = id.str(); changeID = id.str();
// send a copy of the message to the log in case it doesn't manage to reach config.changelog // send a copy of the message to the log in case it doesn't manage to reach config.changelog
Client& c = cc(); Client* c = currentClient.get();
BSONObj msg = BSON( "_id" << changeID << "server" << getHostNameCached() << "clientAddr" << c.clientAddress(true) BSONObj msg = BSON( "_id" << changeID << "server" << getHostNameCached() << "clientAddr" << (c ? c->clientAddress(true) : "N/A")
<< "time" << DATENOW << "what" << what << "ns" << ns << "details" << detail ); << "time" << DATENOW << "what" << what << "ns" << ns << "details" << detail );
log() << "about to log metadata event: " << msg << endl; log() << "about to log metadata event: " << msg << endl;