Fix another unchecked optional

This commit is contained in:
Alexander Rosenberg
2021-10-12 03:30:26 -07:00
parent 3393526876
commit 9694813724

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