diff --git a/luna/include/luna/LinkedList.h b/luna/include/luna/LinkedList.h index 63b858b8..bfb1f2de 100644 --- a/luna/include/luna/LinkedList.h +++ b/luna/include/luna/LinkedList.h @@ -41,8 +41,8 @@ template class LinkedListNode void detach_from_list() { - m_next_node->m_last_node = m_last_node; - m_last_node->m_next_node = m_next_node; + if (m_next_node) m_next_node->m_last_node = m_last_node; + if (m_last_node) m_last_node->m_next_node = m_next_node; } void append_to_list(SelfType* end_node)