From 18149cbc902aea8834f94ae145432c122dcc3090 Mon Sep 17 00:00:00 2001 From: myxmaster Date: Tue, 17 Dec 2024 20:39:08 +0100 Subject: [PATCH] use safe node addition in wallet configuration --- views/Settings/WalletConfiguration.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/Settings/WalletConfiguration.tsx b/views/Settings/WalletConfiguration.tsx index 0d1e9a499..b25f09682 100644 --- a/views/Settings/WalletConfiguration.tsx +++ b/views/Settings/WalletConfiguration.tsx @@ -447,11 +447,13 @@ export default class WalletConfiguration extends React.Component< let nodes: Node[]; let originalNode: Node; if (settings.nodes) { - nodes = settings.nodes; + nodes = [...settings.nodes]; if (index != null) { originalNode = nodes[index]; + nodes[index] = node; + } else { + nodes.push(node); } - nodes[index != null ? index : settings.nodes.length] = node; } else { nodes = [node]; }