Skip to content

Commit 3944e18

Browse files
committed
fix(files_versions): ensure users IDs are strings
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 5a73733 commit 3944e18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/files_versions/src/utils/versions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export async function fetchVersions(fileInfo: any): Promise<Version[]> {
5050
.filter(({ mime }) => mime !== '')
5151
.map(version => formatVersion(version, fileInfo))
5252

53-
const authorIds = new Set(versions.map(version => version.author))
53+
const authorIds = new Set(versions.map(version => String(version.author)))
5454
const authors = await axios.post(generateUrl('/displaynames'), { users: [...authorIds] })
5555

5656
for (const version of versions) {
57-
const author = authors.data.users[version.author]
57+
const author = authors.data.users[version.author ?? '']
5858
if (author) {
5959
version.authorName = author
6060
}

0 commit comments

Comments
 (0)