mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-17 02:56:16 +02:00
Fix crash if message deserialization fails
This commit is contained in:
parent
e94b5534b7
commit
fba20fb7fe
2 changed files with 7 additions and 0 deletions
|
@ -237,6 +237,8 @@ void ClientConnection::getNextMessage(const MessageHandler<msg::BaseMessage>& ha
|
|||
}
|
||||
|
||||
auto response = msg::factory::createMessage(base_message_, buffer_.data());
|
||||
if (!response)
|
||||
LOG(WARNING, LOG_TAG) << "Failed to deserialize message of type: " << base_message_.type << "\n";
|
||||
for (auto iter = pendingRequests_.begin(); iter != pendingRequests_.end(); ++iter)
|
||||
{
|
||||
auto request = *iter;
|
||||
|
|
|
@ -124,6 +124,11 @@ void Controller::getNextMessage()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!response)
|
||||
{
|
||||
return getNextMessage();
|
||||
}
|
||||
|
||||
if (response->type == message_type::kWireChunk)
|
||||
{
|
||||
if (stream_ && decoder_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue