diff --git a/lib/core/checklist.dart b/lib/core/checklist.dart index 93f484e8..c80b3f26 100644 --- a/lib/core/checklist.dart +++ b/lib/core/checklist.dart @@ -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);