Skip to content

Commit e137b6f

Browse files
committed
Fixed noreturn issue when switching pages
1 parent 6c54187 commit e137b6f

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/robomongo/core/mongodb/MongoWorker.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,18 @@ namespace Robomongo
583583
errorStr.contains("FindCommandRequest.ntoreturn", Qt::CaseInsensitive);
584584

585585
// If we have this DocumentDB/Modern Mongo specific error, try again
586-
if (ntoreturnError && _dbclient) {
587-
sendLog(this, LogEvent::RBM_ERROR, std::string(ex.what()));
588-
try {
589-
_dbclient->tagAsDocDb(true);
590-
executeQuery();
591-
return;
592-
}
593-
catch (const std::exception &ex) {
594-
sendLog(this, LogEvent::RBM_ERROR, "Re-try: " + std::string(ex.what()));
586+
if (ntoreturnError) {
587+
mongo::DBClientBase *conn = getConnection(true).first;
588+
if (conn) {
589+
sendLog(this, LogEvent::RBM_ERROR, std::string(ex.what()));
590+
try {
591+
conn->tagAsDocDb(true);
592+
executeQuery();
593+
return;
594+
}
595+
catch (const std::exception &ex) {
596+
sendLog(this, LogEvent::RBM_ERROR, "Re-try: " + std::string(ex.what()));
597+
}
595598
}
596599
}
597600

0 commit comments

Comments
 (0)