diff --git a/ext/libstrawberry-common/core/messagehandler.h b/ext/libstrawberry-common/core/messagehandler.h index 5846f4768..71936326a 100644 --- a/ext/libstrawberry-common/core/messagehandler.h +++ b/ext/libstrawberry-common/core/messagehandler.h @@ -150,10 +150,9 @@ bool AbstractMessageHandler::RawMessageArrived(const QByteArray &data) { return false; } - ReplyType *reply = pending_replies_.take(message.id()); - - if (reply) { + if (pending_replies_.contains(message.id())) { // This is a reply to a message that we created earlier. + ReplyType *reply = pending_replies_.take(message.id()); reply->SetReply(message); } else {