diff --git a/lib/default/TasmotaLList/src/LList.h b/lib/default/TasmotaLList/src/LList.h index fc3a7b559..4c2d2c656 100644 --- a/lib/default/TasmotaLList/src/LList.h +++ b/lib/default/TasmotaLList/src/LList.h @@ -208,6 +208,10 @@ T & LList::addToLast(void) { template T & LList::insertAt(size_t index) { + if (0 == index) { + return addHead(); // insert at the head + } + index--; LList_elt **curr_ptr = &_head; size_t count = 0; while (*curr_ptr) {