mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Checklist: Add an extra assert
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user