LinkedList: Check for nullptrs in detach_from_list()

This commit is contained in:
apio 2022-12-26 12:45:49 +01:00
parent 7e62ee66be
commit 7efb79dd26
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -41,8 +41,8 @@ template <typename T> class LinkedListNode
void detach_from_list() void detach_from_list()
{ {
m_next_node->m_last_node = m_last_node; if (m_next_node) m_next_node->m_last_node = m_last_node;
m_last_node->m_next_node = m_next_node; if (m_last_node) m_last_node->m_next_node = m_next_node;
} }
void append_to_list(SelfType* end_node) void append_to_list(SelfType* end_node)