mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Adds check for active simulator before commands
Implements a check to ensure a simulator is active before processing commands. This prevents errors and unexpected behavior when commands are sent without an active simulator. The check is performed at the beginning of the command parsing, and logs an error if no simulator is active, returning an empty JSON object.
This commit is contained in:
@@ -151,6 +151,11 @@ std::vector<std::string> Simulators::list_simulators() const
|
||||
return names;
|
||||
}
|
||||
|
||||
bool Simulators::is_not_active() const
|
||||
{
|
||||
return this->m_current_simulator.empty();
|
||||
}
|
||||
|
||||
Simulator_base *Simulators::invoke_active_simulator()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
Reference in New Issue
Block a user