Skip to content

Commit 6bbb4e3

Browse files
fix(initial-data): fix error on fetching initial data when user does not have any workspaces (#602) (#603)
* Update user.ts * Bump version up to 1.2.29 --------- Co-authored-by: Peter <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ddbfe36 commit 6bbb4e3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hawk.api",
3-
"version": "1.2.28",
3+
"version": "1.2.29",
44
"main": "index.ts",
55
"license": "BUSL-1.1",
66
"scripts": {

src/models/user.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,16 @@ export default class UserModel extends AbstractModel<UserDBScheme> implements Us
371371
const res = [];
372372

373373
if (ids.length === 0) {
374+
if (!this.workspaces) {
375+
return [];
376+
}
374377
return Object.keys(this.workspaces);
375378
}
376379

380+
if (!this.workspaces) {
381+
return [];
382+
}
383+
377384
for (const id of ids) {
378385
const workspaceId = id.toString();
379386
const workspace = this.workspaces[workspaceId];

0 commit comments

Comments
 (0)