From 52f73a153d524ea927e1a1f3efcade36a3bd3ca5 Mon Sep 17 00:00:00 2001 From: Will Nations Date: Tue, 21 Nov 2017 10:51:38 -0600 Subject: [PATCH] Fixes List::insert_before/after --- core/list.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/list.h b/core/list.h index da201e986817..448be4a5ab6b 100644 --- a/core/list.h +++ b/core/list.h @@ -306,6 +306,8 @@ class List { if (!p_element->next_ptr) { _data->last = n; + } else { + p_element->next_ptr->prev_ptr = n; } p_element->next_ptr = n; @@ -330,6 +332,8 @@ class List { if (!p_element->prev_ptr) { _data->first = n; + } else { + p_element->prev_ptr->next_ptr = n; } p_element->prev_ptr = n;