Fix crash deleting last track

Fixes #263
parent 9d38c49c
Pipeline #4403 passed with stage
in 20 minutes and 55 seconds
......@@ -2011,6 +2011,10 @@ bool TimelineModel::requestTrackDeletion(int trackId)
bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo)
{
Q_ASSERT(isTrack(trackId));
if (m_allTracks.size() < 2) {
pCore->displayMessage(i18n("Cannot delete last track in timeline"), InformationMessage, 500);
return false;
}
std::vector<int> clips_to_delete;
for (const auto &it : getTrackById(trackId)->m_allClips) {
clips_to_delete.push_back(it.first);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment