Skip to content

Commit

Permalink
hotfix on a null reference in grace period management
Browse files Browse the repository at this point in the history
  • Loading branch information
tat2bu committed Jan 3, 2024
1 parent 5225a5f commit 39054bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/extensions/dao/dao.extension.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,11 @@ export class DAOService extends BaseService {
//console.log(row)
const guild = await this.discordClient.getClient().guilds.fetch(row.discord_guild_id)
const member = await guild.members.cache.get(row.discord_user_id)
const role = await guild.roles.cache.get(row.discord_role_id)
member.roles.remove(role)
this.removeGracePeriod(row.discord_guild_id, row.discord_user_id, row.discord_role_id)
if (member && member.roles) {
const role = await guild.roles.cache.get(row.discord_role_id)
member.roles.remove(role)
this.removeGracePeriod(row.discord_guild_id, row.discord_user_id, row.discord_role_id)
}
}
// logger.info('cleaned grace periods')
}
Expand Down

0 comments on commit 39054bf

Please sign in to comment.