server: fix undefined variable for instance actor

This commit is contained in:
Johann150 2022-11-25 19:05:37 +01:00
parent c7255dbea0
commit 062cba1b3c
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -11,10 +11,9 @@ let instanceActor = await Users.findOneBy({
}) as ILocalUser | undefined;
export async function getInstanceActor(): Promise<ILocalUser> {
if (instanceActor) {
return instanceActor;
} else {
if (!instanceActor) {
instanceActor = await createSystemUser(ACTOR_USERNAME) as ILocalUser;
return created;
}
return instanceActor;
}