mirror of
https://github.com/zoriya/flood.git
synced 2025-12-05 23:06:20 +00:00
fix: check if user service is bootstrapped before removing instances (#835)
This commit is contained in:
@@ -46,6 +46,8 @@ export const destroyUserServices = async (userId: UserInDatabase['_id'], drop =
|
||||
|
||||
delete serviceInstances[userId];
|
||||
|
||||
if (userServiceInstances === undefined || userServiceInstances === null) return;
|
||||
|
||||
return Promise.all(
|
||||
Object.keys(userServiceInstances).map((key) => userServiceInstances[key as keyof ServiceInstances].destroy(drop)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user