Merge pull request #39 from Zander671/master

Fix another unchecked optional
This commit is contained in:
ouwou 2021-10-12 18:41:10 +00:00 committed by GitHub
commit 3e34f785c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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