fix: coredump after failing to restart minitouch

This commit is contained in:
Horror Proton
2023-10-27 14:41:38 +08:00
parent 362ef55bcc
commit 12b69a4c61

View File

@@ -111,10 +111,9 @@ std::optional<std::string> asst::MinitouchController::reconnect(const std::strin
bool asst::MinitouchController::input_to_minitouch(const std::string& cmd)
{
if (!m_minitouch_handler->write(cmd)) {
if (!(m_minitouch_handler && m_minitouch_handler->write(cmd))) {
Log.error("Failed to write to minitouch, try restart minitouch and re-write");
call_and_hup_minitouch();
return m_minitouch_handler->write(cmd);
return call_and_hup_minitouch() && m_minitouch_handler->write(cmd);
}
return true;
}