From 7efb79dd2606efcb56d3ee02f17720325f2eb1de Mon Sep 17 00:00:00 2001 From: apio Date: Mon, 26 Dec 2022 12:45:49 +0100 Subject: [PATCH] LinkedList: Check for nullptrs in detach_from_list() --- luna/include/luna/LinkedList.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)