fix: 启动时连续截图出错10次导致MAA崩溃

This commit is contained in:
status102
2024-02-07 18:08:23 +08:00
parent 6f7f876373
commit ba4ab76fc0

View File

@@ -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);