summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-11 00:12:43 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-12 21:38:11 -0400
commit7b54a3ca48318fd3cae69e8c67e6294b0d8978f7 (patch)
treea55c61344e19b690fc57beb4d2ea4e6b8c4bf76d /packages/backend/src/queue/processors/DeleteAccountProcessorService.ts
parentdelete user registry items (diff)
downloadsharkey-7b54a3ca48318fd3cae69e8c67e6294b0d8978f7.tar.gz
sharkey-7b54a3ca48318fd3cae69e8c67e6294b0d8978f7.tar.bz2
sharkey-7b54a3ca48318fd3cae69e8c67e6294b0d8978f7.zip
allow user to be deleted if profile is missing
Diffstat (limited to 'packages/backend/src/queue/processors/DeleteAccountProcessorService.ts')
-rw-r--r--packages/backend/src/queue/processors/DeleteAccountProcessorService.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts
index 0ca4945948..4e9779a41b 100644
--- a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts
+++ b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts
@@ -357,7 +357,7 @@ export class DeleteAccountProcessorService {
}
// Do this BEFORE deleting the account!
- const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
+ const profile = await this.userProfilesRepository.findOneBy({ userId: user.id });
{ // Delete the actual account
await this.userIpsRepository.delete({
@@ -383,7 +383,7 @@ export class DeleteAccountProcessorService {
}
{ // Send email notification
- if (profile.email && profile.emailVerified) {
+ if (profile && profile.email && profile.emailVerified) {
try {
await this.emailService.sendEmail(profile.email, 'Account deleted',
'Your account has been deleted.',