Skip to content

Commit 2eeccc4

Browse files
authored
fix: 修复根据用户名查询文件时,没有找到用户id时报错问题 (#81)
1 parent ae2dbfe commit 2eeccc4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/modules/tools/storage/storage.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class StorageService {
6060
...(size && { size: Between(size[0], size[1]) }),
6161
...(time && { createdAt: Between(time[0], time[1]) }),
6262
...(username && {
63-
userId: await (await this.userRepository.findOneBy({ username })).id,
63+
userId: await (await this.userRepository.findOneBy({ username }))?.id,
6464
}),
6565
})
6666
.orderBy('storage.created_at', 'DESC')

0 commit comments

Comments
 (0)