diff options
-rw-r--r-- | discord/discord.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 257df5c..c494145 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -173,7 +173,8 @@ void DiscordClient::FetchMessagesInChannelBefore(Snowflake channel_id, Snowflake m_store.BeginTransaction(); for (auto &msg : msgs) { StoreMessageData(msg); - AddUserToGuild(msg.Author.ID, *msg.GuildID); + if (msg.GuildID.has_value()) + AddUserToGuild(msg.Author.ID, *msg.GuildID); } m_store.EndTransaction(); |