1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-12 07:35:51 +01:00

Fix a clang compiler warning

This commit is contained in:
Paul Licameli
2018-11-12 23:04:00 -05:00
parent 53fcd07b77
commit 6e14dab4f4

View File

@@ -514,22 +514,20 @@ void QuickFixDialog::OnFix(wxCommandEvent &event)
gPrefs->Write( Str, 0); gPrefs->Write( Str, 0);
gPrefs->Flush(); gPrefs->Flush();
AudacityProject & project = *GetActiveProject(); if ( auto pProject = GetActiveProject() ) {
if( &project == nullptr)
(void)0;// Compiler food.
// Sadly SnapTo has to be handled specially, as it is not part of the standard // Sadly SnapTo has to be handled specially, as it is not part of the standard
// preference dialogs. // preference dialogs.
else if( Str == "/SnapTo" ) if( Str == "/SnapTo" )
{ {
project.SetSnapTo( 0 ); pProject->SetSnapTo( 0 );
} }
else else
{ {
// This is overkill (aka slow), as all preferences are reloaded and all // This is overkill (aka slow), as all preferences are reloaded and all
// toolbars recreated. // toolbars recreated.
// Overkill probably doesn't matter, as this command is infrequently used. // Overkill probably doesn't matter, as this command is infrequently used.
EditActions::DoReloadPreferences( project ); EditActions::DoReloadPreferences( *pProject );
}
} }
// Change the label after doing the fix, as the fix may take a second or two. // Change the label after doing the fix, as the fix may take a second or two.