From ed616130b86d1d8b3b1575fedc96c197c70937c9 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 30 Dec 2021 11:04:26 +0100 Subject: [PATCH] fixes --- packages/api/src/controllers/connections.js | 2 +- packages/api/src/controllers/databaseConnections.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/api/src/controllers/connections.js b/packages/api/src/controllers/connections.js index c984e07c..5ec9873d 100644 --- a/packages/api/src/controllers/connections.js +++ b/packages/api/src/controllers/connections.js @@ -214,7 +214,7 @@ module.exports = { get_meta: true, async get({ conid }) { - if (portalConnections) return portalConnections.find(x => x._id == conid); + if (portalConnections) return portalConnections.find(x => x._id == conid) || null; const res = await this.datastore.find({ _id: conid }); return res[0] || null; }, diff --git a/packages/api/src/controllers/databaseConnections.js b/packages/api/src/controllers/databaseConnections.js index 9fb8b8ec..d0911adc 100644 --- a/packages/api/src/controllers/databaseConnections.js +++ b/packages/api/src/controllers/databaseConnections.js @@ -252,6 +252,7 @@ module.exports = { serverVersion_meta: true, async serverVersion({ conid, database }) { + if (!conid) return null; const opened = await this.ensureOpened(conid, database); return opened.serverVersion || null; },