소스 검색

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

Thanks to simon816 and xet7 !

Fixes #4596
Lauri Ojansivu 3 년 전
부모
커밋
4941fd183c
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      server/statistics.js

+ 8 - 4
server/statistics.js

@@ -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';