fix potential stack overflow

this will only happen if:
there is a CHANNEL_UPDATE on a channel
the channel is part of a guild which is in a folder
and the channel is so old that it shares its id with the guild
This commit is contained in:
ouwou committed 2023-02-06 03:02:05 -05:00
1 parent 156bd2b720
commit 41a616edb4
1 file changed
+1 -1
+1 -1
View File
@@ -799,7 +799,7 @@ Gtk::TreeModel::iterator ChannelList::GetIteratorForChannelFromID(Snowflake id)
while (!queue.empty()) {
auto item = queue.front();
if ((*item)[m_columns.m_id] == id) return item;
if ((*item)[m_columns.m_id] == id && (*item)[m_columns.m_type] != RenderType::Guild) return item;
for (const auto &child : item->children())
queue.push(child);
queue.pop();