From ba4ab76fc0de7793acbfc95137068d4ad81be4e9 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Wed, 7 Feb 2024 18:08:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=AF=E5=8A=A8=E6=97=B6=E8=BF=9E?= =?UTF-8?q?=E7=BB=AD=E6=88=AA=E5=9B=BE=E5=87=BA=E9=94=9910=E6=AC=A1?= =?UTF-8?q?=E5=AF=BC=E8=87=B4MAA=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Controller/AdbController.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MaaCore/Controller/AdbController.cpp b/src/MaaCore/Controller/AdbController.cpp index 6e5b4cb885..3dd4e187bc 100644 --- a/src/MaaCore/Controller/AdbController.cpp +++ b/src/MaaCore/Controller/AdbController.cpp @@ -477,7 +477,9 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect json::object { { "min", screencap_cost_min }, { "max", screencap_cost_max }, - { "avg", std::accumulate(filted_duration.begin(), filted_duration.end(), 0ll) / filted_count }, + { "avg", filted_count > 0 + ? std::accumulate(filted_duration.begin(), filted_duration.end(), 0ll) / filted_count + : -1 }, } }, }; callback(AsstMsg::ConnectionInfo, info);