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:
parent
f5410cee9c
commit
85f870f607
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue