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

Fix crash caused by incorrect group saved

Should fix #491 and others
parent 86b2cd2e
......@@ -820,7 +820,7 @@ int GroupsModel::fromJson(const QJsonObject &o, Fun &undo, Fun &redo)
}
ids.insert(fromJson(c.toObject(), undo, redo));
}
if (ids.count(-1) > 0) {
if (ids.count(-1) > 0 || type == GroupType::Selection) {
return -1;
}
return groupItems(ids, undo, redo, type);
......@@ -924,7 +924,6 @@ bool GroupsModel::fromJsonWithOffset(const QString &data, const QMap<int, int> &
}
ok = ok && fromJson(elem.toObject(), local_undo, local_redo);
}
if (ok) {
UPDATE_UNDO_REDO(local_redo, local_undo, undo, redo);
} else {
......
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