mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 19:20:34 +08:00
Runtime check in linked list insert()
This commit is contained in:
@@ -100,6 +100,10 @@ template <typename T>
|
||||
void LinkedListRoot<T>::insert(T* node)
|
||||
{
|
||||
UAVCAN_ASSERT(node);
|
||||
if (node == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
remove(node); // Making sure there will be no loops
|
||||
node->setNextListNode(root_);
|
||||
root_ = node;
|
||||
|
||||
Reference in New Issue
Block a user