diff --git a/packages/backend/src/core/SystemAccountService.ts b/packages/backend/src/core/SystemAccountService.ts index 710e797213..1f42bc6a65 100644 --- a/packages/backend/src/core/SystemAccountService.ts +++ b/packages/backend/src/core/SystemAccountService.ts @@ -150,12 +150,16 @@ export class SystemAccountService { const updates = {} as Partial; if (extra.name !== undefined) updates.name = extra.name; - await this.usersRepository.update(user.id, updates); + if (Object.keys(updates).length > 0) { + await this.usersRepository.update(user.id, updates); + } const profileUpdates = {} as Partial; if (extra.description !== undefined) profileUpdates.description = extra.description; - await this.userProfilesRepository.update(user.id, profileUpdates); + if (Object.keys(profileUpdates).length > 0) { + await this.userProfilesRepository.update(user.id, profileUpdates); + } const updated = await this.usersRepository.findOneByOrFail({ id: user.id }) as MiLocalUser; this.cache.set(type, updated);