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

Fix possible crash on incorrect active effect

Fixes #1186
parent 008cbd49
......@@ -1104,7 +1104,7 @@ void EffectStackModel::setActiveEffect(int ix)
ptr->set("kdenlive:activeeffect", ix);
}
// Desactivate previous effect
if (current > -1 && current != ix) {
if (current > -1 && current != ix && current < rootItem->childCount()) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(current));
if (effect) {
effect->setActive(false);
......
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