From 062cba1b3c0511e4506d3b7b10dbbf591480be91 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Fri, 25 Nov 2022 19:05:37 +0100 Subject: [PATCH] server: fix undefined variable for instance actor --- packages/backend/src/services/instance-actor.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/services/instance-actor.ts b/packages/backend/src/services/instance-actor.ts index 874952be0..279142b32 100644 --- a/packages/backend/src/services/instance-actor.ts +++ b/packages/backend/src/services/instance-actor.ts @@ -11,10 +11,9 @@ let instanceActor = await Users.findOneBy({ }) as ILocalUser | undefined; export async function getInstanceActor(): Promise { - if (instanceActor) { - return instanceActor; - } else { + if (!instanceActor) { instanceActor = await createSystemUser(ACTOR_USERNAME) as ILocalUser; - return created; } + + return instanceActor; }