mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
b message parser
fix core dump when an event is called and no sim is active
This commit is contained in:
@@ -64,6 +64,11 @@ void event_handler(json event)
|
|||||||
{
|
{
|
||||||
std::string type = event["type"];
|
std::string type = event["type"];
|
||||||
Event e = magic_enum::enum_cast<Event>(type).value_or(Event::end);
|
Event e = magic_enum::enum_cast<Event>(type).value_or(Event::end);
|
||||||
|
if (g_simulators->invoke_active_simulator() == nullptr)
|
||||||
|
{
|
||||||
|
spdlog::error("Event got called but there is no active simulator");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch(e)
|
switch(e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user