Skip to content

Commit f550b54

Browse files
authored
fix: check if user service is bootstrapped before removing instances (#835)
1 parent 99a1b6b commit f550b54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/services/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export const destroyUserServices = async (userId: UserInDatabase['_id'], drop =
4646

4747
delete serviceInstances[userId];
4848

49+
if (userServiceInstances === undefined || userServiceInstances === null) return;
50+
4951
return Promise.all(
5052
Object.keys(userServiceInstances).map((key) => userServiceInstances[key as keyof ServiceInstances].destroy(drop)),
5153
);

0 commit comments

Comments
 (0)