Skip to content

Commit

Permalink
Fix delete user error
Browse files Browse the repository at this point in the history
  • Loading branch information
yinxin630 committed Sep 22, 2021
1 parent 1cdc920 commit 1fdb0ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bin/scripts/deleteUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function deleteUser(userId: string, confirm = true) {
console.log('Leave', group.name);
const index = group.members.indexOf(user?._id);
group.members.splice(index, 1);
if (group.creator.toString() === user?._id.toString()) {
if (group.creator?.toString() === user?._id.toString()) {
// @ts-ignore
group.creator = null;
}
Expand Down

0 comments on commit 1fdb0ad

Please sign in to comment.