From ecd09ad6a8835203d33ebf60661121f605f8f3c8 Mon Sep 17 00:00:00 2001 From: Viacheslav Demydiuk Date: Fri, 12 Jan 2024 18:21:29 +0200 Subject: [PATCH] Small fix in MtService --- MtService/MtServer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MtService/MtServer.cpp b/MtService/MtServer.cpp index 891427d6..85113454 100755 --- a/MtService/MtServer.cpp +++ b/MtService/MtServer.cpp @@ -181,9 +181,10 @@ void MtServer::OnAccept(boost::beast::error_code ec, auto command = ParseCommand(msg); if (command) { - if (experts_.count(command->getExpertHandle()) > 0) + auto expert_handle = command->getExpertHandle(); + if (experts_.count(expert_handle) > 0) { - experts_[command->getExpertHandle()]->expert->Process(std::move(command), [&](const MtResponse& response) { + experts_[expert_handle]->expert->Process(std::move(command), [&](const MtResponse& response) { auto connection = con.lock(); if (connection) connection->Send(response.Serialize());