From 6ab55ebcb758103841463aec404f38aa424a53ef Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Thu, 12 Aug 2021 16:58:34 +0000 Subject: Fix error while importing without workspaces (#1776) fixes #1773 --- src/internal-server/app/Controllers/Http/UserController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/internal-server') diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js index 88c0deade..a3ad736fa 100644 --- a/src/internal-server/app/Controllers/Http/UserController.js +++ b/src/internal-server/app/Controllers/Http/UserController.js @@ -346,7 +346,9 @@ class UserController { workspaceId = uuid(); } while ((await Workspace.query().where('workspaceId', workspaceId).fetch()).rows.length > 0); // eslint-disable-line no-await-in-loop - const services = workspace.services.map((service) => serviceIdTranslation[service]); + const services = (workspace.services && typeof (workspace.services) === 'object') ? + workspace.services.map((service) => serviceIdTranslation[service]) : + []; await Workspace.create({ // eslint-disable-line no-await-in-loop workspaceId, -- cgit v1.2.3-54-g00ecf