diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-11-20 18:48:15 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-11-20 18:48:15 -0500 |
commit | 574cbc35d85d5f90e2d5946da636f9c1cc0cd2ad (patch) | |
tree | 3797355d4db144311820b499501ff104e0eadd9a /discord/guild.cpp | |
parent | 9d21df8e1bca9ccfa1bcfcde3bc8f35473866166 (diff) | |
parent | fc76a15c4636df4961af1879ddecb111a9f68260 (diff) | |
download | abaddon-portaudio-574cbc35d85d5f90e2d5946da636f9c1cc0cd2ad.tar.gz abaddon-portaudio-574cbc35d85d5f90e2d5946da636f9c1cc0cd2ad.zip |
merge store
Diffstat (limited to 'discord/guild.cpp')
-rw-r--r-- | discord/guild.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/guild.cpp b/discord/guild.cpp index 23a45ee..f0b70d7 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -192,8 +192,11 @@ std::vector<RoleData> GuildData::FetchRoles() const { if (!Roles.has_value()) return {}; std::vector<RoleData> ret; ret.reserve(Roles->size()); - for (const auto &thing : *Roles) - ret.push_back(*Abaddon::Get().GetDiscordClient().GetRole(thing.ID)); + for (const auto thing : *Roles) { + auto r = Abaddon::Get().GetDiscordClient().GetRole(thing.ID); + if (r.has_value()) + ret.push_back(*r); + } std::sort(ret.begin(), ret.end(), [](const RoleData &a, const RoleData &b) -> bool { return a.Position > b.Position; }); |