Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

channel == nullptr #25

Open
zeroxs opened this issue Nov 6, 2019 · 0 comments
Open

channel == nullptr #25

zeroxs opened this issue Nov 6, 2019 · 0 comments
Labels

Comments

@zeroxs
Copy link
Owner

zeroxs commented Nov 6, 2019

Due to the async design, a MESSAGE_CREATE can be processed prior to a GUILD_CREATE creating the scenario of a message being handled that has no channel in the cache which leads to the message being rejected.

log->warn("Shard#{} - channel == nullptr - {} {} {}", _shard->get_id(), c_id, result["d"]["author"]["id"].get<std::string>(), result["d"]["content"].get<std::string>());

Solution is to perform a create_channel() to create a semi-empty channel so the message can still be handled. This would be best accomplished with some sort of flag in the channel object itself to identify whether or not the channel is in this empty state or has been populated by a GUILD_CREATE or CHANNEL_CREATE.

@zeroxs zeroxs added the design label Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant