Try to fix missing variable in WeKan fails to get MongoDB server version.

Thanks to simon816 and xet7 !

Fixes #4596
This commit is contained in:
Lauri Ojansivu 2022-08-04 02:37:34 +03:00
parent 2be017cf4a
commit 4941fd183c

View file

@ -86,10 +86,14 @@ if (Meteor.isServer) {
mongoOplogEnabled = oplogEnabled;
} catch (e) {
try {
const { version } = Promise.await(
mongo.db.command({ buildinfo: 1 }),
);
mongoVersion = version;
if (mongo === undefined) {
mongoVersion = 'unknown';
} else {
const { version } = Promise.await(
mongo.db.command({ buildinfo: 1 }),
);
mongoVersion = version;
}
mongoStorageEngine = 'unknown';
} catch (e) {
mongoVersion = 'unknown';