mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 08:01:19 +02:00
Prevent NULL pointer dereferences due to the controls
never being created when no projects are open on OSX. (The root window is active.)
This commit is contained in:
parent
be0da23cdf
commit
00314f9564
@ -610,6 +610,15 @@ void KeyConfigPrefs::OnViewBy(wxCommandEvent & e)
|
||||
|
||||
bool KeyConfigPrefs::Apply()
|
||||
{
|
||||
// On the Mac, preferences may be changed without any active
|
||||
// projects. This means that the CommandManager isn't availabe
|
||||
// either. So we can't attempt to save preferences, otherwise
|
||||
// NULL ptr dereferences will happen in ShuttleGui because the
|
||||
// radio buttons are never created. (See Populate() above.)
|
||||
if (!GetActiveProject()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user