1
0
Fork 0

macOS: don’t crash if menu items are used early

Because we create the menubar earlier on macOS, the user can select
items before Nasal is loaded, causing a crash.
This commit is contained in:
James Turner 2020-12-28 15:07:16 +00:00
parent f5410cee9c
commit 85f870f607

View file

@ -195,7 +195,13 @@ do_null (const SGPropertyNode * arg, SGPropertyNode * root)
static bool
do_nasal (const SGPropertyNode * arg, SGPropertyNode * root)
{
return ((FGNasalSys*)globals->get_subsystem("nasal"))->handleCommand(arg, root);
auto nasalSys = globals->get_subsystem<FGNasalSys>();
if (!nasalSys) {
SG_LOG(SG_GUI, SG_ALERT, "do_nasal command: Nasal subsystem not found");
return false;
}
return nasalSys->handleCommand(arg, root);
}
/**