Commit a8e74a7f authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash in extract zone when no track is active.

Fixes #310
parent e1c677c2
Pipeline #6301 passed with stage
in 21 minutes and 20 seconds
......@@ -314,7 +314,7 @@ bool TimelineFunctions::extractZone(const std::shared_ptr<TimelineItemModel> &ti
std::function<bool(void)> redo = []() { return true; };
bool result = true;
result = breakAffectedGroups(timeline, tracks, zone, undo, redo);
for (int &trackId : tracks) {
if (timeline->getTrackById_const(trackId)->isLocked()) {
continue;
......@@ -424,7 +424,6 @@ bool TimelineFunctions::liftZone(const std::shared_ptr<TimelineItemModel> &timel
bool TimelineFunctions::removeSpace(const std::shared_ptr<TimelineItemModel> &timeline, int trackId, QPoint zone, Fun &undo, Fun &redo, QVector<int> allowedTracks)
{
Q_UNUSED(trackId)
std::unordered_set<int> clips;
auto it = timeline->m_allTracks.cbegin();
while (it != timeline->m_allTracks.cend()) {
......@@ -435,6 +434,10 @@ bool TimelineFunctions::removeSpace(const std::shared_ptr<TimelineItemModel> &ti
}
++it;
}
if (clips.size() == 0) {
// TODO: inform user no change will be performed
return true;
}
bool result = false;
timeline->requestSetSelection(clips);
int itemId = *clips.begin();
......
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