diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-12 16:58:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-12 22:28:34 +0530 |
commit | 6ab55ebcb758103841463aec404f38aa424a53ef (patch) | |
tree | 0b53b20d0c4ef64f54dfdcd3da190c4e27ac4ad8 | |
parent | Services now support aliases!!!! (#1774) (diff) | |
download | ferdium-app-6ab55ebcb758103841463aec404f38aa424a53ef.tar.gz ferdium-app-6ab55ebcb758103841463aec404f38aa424a53ef.tar.zst ferdium-app-6ab55ebcb758103841463aec404f38aa424a53ef.zip |
Fix error while importing without workspaces (#1776)
fixes #1773
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/internal-server/app/Controllers/Http/UserController.js | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index eb42f4433..e043ac1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -6,7 +6,8 @@ | |||
6 | ### Bug Fixes | 6 | ### Bug Fixes |
7 | 7 | ||
8 | - Fix startup crash for Ferdi v5.6.1-nightly.23 💖 @vraravam | 8 | - Fix startup crash for Ferdi v5.6.1-nightly.23 💖 @vraravam |
9 | - Fixed the sidebar context menu for toggling dark mode. 💖 @vraravam | 9 | - Fix the sidebar context menu for toggling dark mode. 💖 @vraravam |
10 | - Fix error while importing ferdi data (#1776) 💖 @vraravam | ||
10 | 11 | ||
11 | ### Internal | 12 | ### Internal |
12 | 13 | ||
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 { | |||
346 | workspaceId = uuid(); | 346 | workspaceId = uuid(); |
347 | } while ((await Workspace.query().where('workspaceId', workspaceId).fetch()).rows.length > 0); // eslint-disable-line no-await-in-loop | 347 | } while ((await Workspace.query().where('workspaceId', workspaceId).fetch()).rows.length > 0); // eslint-disable-line no-await-in-loop |
348 | 348 | ||
349 | const services = workspace.services.map((service) => serviceIdTranslation[service]); | 349 | const services = (workspace.services && typeof (workspace.services) === 'object') ? |
350 | workspace.services.map((service) => serviceIdTranslation[service]) : | ||
351 | []; | ||
350 | 352 | ||
351 | await Workspace.create({ // eslint-disable-line no-await-in-loop | 353 | await Workspace.create({ // eslint-disable-line no-await-in-loop |
352 | workspaceId, | 354 | workspaceId, |