Commit 6f2097da authored by Martin Koller's avatar Martin Koller

avoid crash when reading from connection times out

Differential Revision: https://phabricator.kde.org/D5681
parent be739709
......@@ -212,7 +212,7 @@ void Connection::dataReceived()
} catch (const Akonadi::ProtocolException &) {
// cmd's type will be Invalid by default.
}
if (cmd->type() == Protocol::Command::Invalid) {
if (!cmd || (cmd->type() == Protocol::Command::Invalid)) {
qCWarning(AKONADICORE_LOG) << "Invalid command, the world is going to end!";
mSocket->close();
mSocket->readAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment