Skip to content

Commit

Permalink
(#62) Prevent creating a role when category does not exist
Browse files Browse the repository at this point in the history
Fixes #62
  • Loading branch information
mkevenaar committed Jun 14, 2022
1 parent 3adad31 commit 810b551
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/database/reaction.role.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class ReactionRoleService {

static async create(guildId, categoryName, role, description, emoji) {
let existingRole;
let existingCategory = await ReactionService.get(guildId, categoryName);

try {
existingRole = await this.get(guildId, categoryName, role.id);
Expand Down

0 comments on commit 810b551

Please sign in to comment.