1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-26 00:58:37 +02:00

Track menu: opening track menu by pressing shift+M causes crash

Fix:
Call TrackPanel::OnTrackMenu(Track *t) with a track pointer.

Query:
Is there any reason why this function's parameter has a default value of NULL?
This commit is contained in:
David Bailes 2019-06-28 10:09:11 +01:00
parent 8e2453f0b7
commit af74ff626e

View File

@ -1145,8 +1145,9 @@ void OnTrackMenu(const CommandContext &context)
{ {
auto &project = context.project; auto &project = context.project;
auto &trackPanel = TrackPanel::Get( project ); auto &trackPanel = TrackPanel::Get( project );
auto track = trackPanel.GetFocusedTrack();
trackPanel.OnTrackMenu(); if (track)
trackPanel.OnTrackMenu(track);
} }
void OnTrackMute(const CommandContext &context) void OnTrackMute(const CommandContext &context)