fixed a bug where we'd immediately crash on any message

This commit is contained in:
Adam R Grey 2024-05-10 17:07:50 -04:00
parent 54414b8748
commit c446521977

View File

@ -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;