From 657f777d260f7efef077051cc2dc05184391f0a9 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Tue, 23 Jul 2024 14:38:18 -0700 Subject: [PATCH] parent check should go after thread check --- server.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 2968df8..ecfd549 100755 --- a/server.go +++ b/server.go @@ -447,6 +447,12 @@ func (s *server) getForum(w http.ResponseWriter, r *http.Request) { } var posts []Post for _, thread := range channels { + + if thread.ParentID != forum.ID || + thread.Type != discord.GuildPublicThread { + continue + } + parent, err := s.channel(thread.ParentID) if err != nil { s.displayErr(w, http.StatusInternalServerError, @@ -458,10 +464,6 @@ func (s *server) getForum(w http.ResponseWriter, r *http.Request) { if parent.Type != discord.GuildForum { continue } - if thread.ParentID != forum.ID || - thread.Type != discord.GuildPublicThread { - continue - } post := Post{Channel: thread} for _, tag := range thread.AppliedTags { for _, availtag := range forum.AvailableTags {