From 4d62944dbb0fe2a803f94e05bddc67ef7c8947fe Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 9 Jan 2021 02:10:48 -0500 Subject: fix channel/guild updates --- discord/guild.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'discord/guild.cpp') diff --git a/discord/guild.cpp b/discord/guild.cpp index 6b26f25..40762ad 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -141,10 +141,9 @@ std::vector GuildData::GetSortedChannels(Snowflake ignore) const { std::map> orphan_channels; for (const auto &channel_id : channels) { const auto data = discord.GetChannel(channel_id); - if (!data.has_value()) continue; - if (!data->ParentID->IsValid() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS)) + if (!data->ParentID.has_value() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS)) orphan_channels[*data->Position].push_back(*data); - else if (data->ParentID->IsValid() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS)) + else if (data->ParentID.has_value() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS)) category_to_channels[*data->ParentID].push_back(*data); else if (data->Type == ChannelType::GUILD_CATEGORY) position_to_categories[*data->Position].push_back(*data); -- cgit v1.2.3