From c44652197711eefd8b588269fc82895d2f32e03c Mon Sep 17 00:00:00 2001 From: Adam R Grey Date: Fri, 10 May 2024 17:07:50 -0400 Subject: [PATCH] fixed a bug where we'd immediately crash on any message --- Models/Channel.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Models/Channel.cs b/Models/Channel.cs index e01657e..6eaea55 100644 --- a/Models/Channel.cs +++ b/Models/Channel.cs @@ -49,17 +49,16 @@ public class Channel path.Push(walker); } DefinitePermissionSettings toReturn = new DefinitePermissionSettings(); - walker = path.Pop(); - while(walker != null) + + while(path.Count > 0) { - toReturn.LewdnessFilterLevel = LewdnessFilterLevel ?? toReturn.LewdnessFilterLevel; - toReturn.MeannessFilterLevel = MeannessFilterLevel ?? toReturn.MeannessFilterLevel; - toReturn.LinksAllowed = LinksAllowed ?? toReturn.LinksAllowed; - toReturn.MaxAttachmentBytes = MaxAttachmentBytes ?? toReturn.MaxAttachmentBytes; - toReturn.MaxTextChars = MaxTextChars ?? toReturn.MaxTextChars; - toReturn.ReactionsPossible = ReactionsPossible ?? toReturn.ReactionsPossible; - walker = path.Pop(); + toReturn.LewdnessFilterLevel = walker.LewdnessFilterLevel ?? toReturn.LewdnessFilterLevel; + toReturn.MeannessFilterLevel = walker.MeannessFilterLevel ?? toReturn.MeannessFilterLevel; + toReturn.LinksAllowed = walker.LinksAllowed ?? toReturn.LinksAllowed; + toReturn.MaxAttachmentBytes = walker.MaxAttachmentBytes ?? toReturn.MaxAttachmentBytes; + toReturn.MaxTextChars = walker.MaxTextChars ?? toReturn.MaxTextChars; + toReturn.ReactionsPossible = walker.ReactionsPossible ?? toReturn.ReactionsPossible; } return toReturn;