1
0
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:
lllucius@gmail.com 2013-10-03 14:50:58 +00:00
parent be0da23cdf
commit 00314f9564

View File

@ -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);