Checklist: Add an extra assert

This commit is contained in:
Vishesh Handa
2020-04-03 19:39:03 +02:00
parent ea5667fcde
commit ceffa89eb2

View File

@ -142,6 +142,7 @@ class Checklist {
}
void insertItem(int index, ChecklistItem item) {
assert(index <= items.length, "Trying to insert beyond the end");
if (index == 0) {
items.insert(0, item);
nodes.insert(0, item.element);