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

Fix crash on item deletion. Fixes #235

parent bcf6eae1
Pipeline #4125 passed with stage
in 26 minutes and 2 seconds
......@@ -752,8 +752,10 @@ void ClipModel::setSelected(bool sel)
}
selected = sel;
if (auto ptr = m_parent.lock()) {
QModelIndex ix = ptr->makeClipIndexFromID(m_id);
ptr->dataChanged(ix, ix, {TimelineModel::SelectedRole});
if (m_currentTrackId != -1) {
QModelIndex ix = ptr->makeClipIndexFromID(m_id);
ptr->dataChanged(ix, ix, {TimelineModel::SelectedRole});
}
}
}
......
......@@ -271,8 +271,10 @@ void CompositionModel::setSelected(bool sel)
}
selected = sel;
if (auto ptr = m_parent.lock()) {
QModelIndex ix = ptr->makeCompositionIndexFromID(m_id);
ptr->dataChanged(ix, ix, {TimelineModel::SelectedRole});
if (m_currentTrackId != -1) {
QModelIndex ix = ptr->makeCompositionIndexFromID(m_id);
ptr->dataChanged(ix, ix, {TimelineModel::SelectedRole});
}
}
}
......
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