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 {