mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-19 02:16:55 +08:00
Added nullptr check in remove_node_after
This commit is contained in:
parent
1ba191fa51
commit
02211e969c
@ -1025,14 +1025,17 @@ namespace etl
|
||||
// The node to erase.
|
||||
Node* p_node = node.next;
|
||||
|
||||
// Disconnect the node from the forward_list.
|
||||
join(node, *p_node->next);
|
||||
if (p_node != nullptr)
|
||||
{
|
||||
// Disconnect the node from the forward_list.
|
||||
join(node, *p_node->next);
|
||||
|
||||
// Destroy the pool object.
|
||||
destroy_data_node(static_cast<Data_Node&>(*p_node));
|
||||
// Destroy the pool object.
|
||||
destroy_data_node(static_cast<Data_Node&>(*p_node));
|
||||
|
||||
// One less.
|
||||
--current_size;
|
||||
// One less.
|
||||
--current_size;
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user