mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 22:12:58 +02:00
Redo previous commit's fix...
... the bug was introduced at e581fa60d9
I think it is better to make TrackPanel::OnTrackMenu crash-proof when
called with the default argument
This commit is contained in:
@@ -992,7 +992,7 @@ void TrackPanel::ScrollIntoView(int x)
|
||||
|
||||
void TrackPanel::OnTrackMenu(Track *t)
|
||||
{
|
||||
CellularPanel::DoContextMenu( &TrackView::Get( *t ) );
|
||||
CellularPanel::DoContextMenu( t ? &TrackView::Get( *t ) : nullptr );
|
||||
}
|
||||
|
||||
// Tracks have been removed from the list.
|
||||
|
@@ -1145,9 +1145,8 @@ void OnTrackMenu(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
auto track = trackPanel.GetFocusedTrack();
|
||||
if (track)
|
||||
trackPanel.OnTrackMenu(track);
|
||||
|
||||
trackPanel.OnTrackMenu();
|
||||
}
|
||||
|
||||
void OnTrackMute(const CommandContext &context)
|
||||
|
Reference in New Issue
Block a user