diff --git a/libuavcan/include/uavcan/util/linked_list.hpp b/libuavcan/include/uavcan/util/linked_list.hpp index 963cee9f02..d36e83b463 100644 --- a/libuavcan/include/uavcan/util/linked_list.hpp +++ b/libuavcan/include/uavcan/util/linked_list.hpp @@ -100,6 +100,10 @@ template void LinkedListRoot::insert(T* node) { UAVCAN_ASSERT(node); + if (node == NULL) + { + return; + } remove(node); // Making sure there will be no loops node->setNextListNode(root_); root_ = node;