Skip to content

Commit 462138d

Browse files
committed
Fix message not being able to be detached if the og channel was deleted
1 parent 3a5367d commit 462138d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/commands/DetachFormSubcommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void handleAutoComplete(CommandAutoCompleteInteractionEvent event, AutoCo
8888
public static void detachFromMessage(FormData form, Guild guild) {
8989
if (!form.isAttached()) return;
9090
TextChannel formChannel = guild.getTextChannelById(form.getMessageChannel().get());
91-
formChannel.retrieveMessageById(form.getMessageId().get()).queue(msg -> {
91+
if (formChannel != null) formChannel.retrieveMessageById(form.getMessageId().get()).queue(msg -> {
9292
List<ActionRow> components = msg.getComponents().stream().map(msgComponent -> {
9393
ActionRow row = msgComponent.asActionRow();
9494
List<ActionRowChildComponentUnion> cpts = row.getComponents().stream().filter(cpt -> {

0 commit comments

Comments
 (0)