Skip to content
Snippets Groups Projects
Verified Commit 3f5d50d5 authored by Björn Eßwein's avatar Björn Eßwein
Browse files

Fix index out of range excaption because of mistaking a nodeId for a array index.

parent 8cd56ed2
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,8 @@ namespace bessw.Unity.WebView.ChromeDevTools
var childNode = createOrUpdateNode(tab, eventData.node.nodeId, eventData.parentNodeId, eventData.node.backendNodeId, eventData.node);
if (parentNode.Node != null && childNode.Node != null)
{
parentNode.Node.children.Insert(eventData.previousNodeId, childNode.Node);
var idx = parentNode.Node.children.FindIndex(node => node.nodeId == eventData.previousNodeId) + 1;
parentNode.Node.children.Insert(idx, childNode.Node);
parentNode.OnDomChildNodeInserted?.Invoke(eventData);
} else {
throw new InvalidOperationException("ChildNodeInserted event was fired, the node info has not yet been recieved");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment