From 18a02b1717211b2444fc9b770519883fbdfc50f6 Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 7 Jun 2024 16:37:31 +0200 Subject: [PATCH] Implements mapping of debug/info routing table nodes --- ProjectPlugins/CodexPlugin/Mapper.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ProjectPlugins/CodexPlugin/Mapper.cs b/ProjectPlugins/CodexPlugin/Mapper.cs index 0c695e0..6e59c68 100644 --- a/ProjectPlugins/CodexPlugin/Mapper.cs +++ b/ProjectPlugins/CodexPlugin/Mapper.cs @@ -110,7 +110,7 @@ namespace CodexPlugin return new DebugInfoTable { LocalNode = MapDebugInfoTableNode(obj.GetValue("localNode")), - Nodes = new DebugInfoTableNode[0] + Nodes = MapDebugInfoTableNodeArray(obj.GetValue("nodes") as JArray) }; } @@ -129,6 +129,16 @@ namespace CodexPlugin }; } + private DebugInfoTableNode[] MapDebugInfoTableNodeArray(JArray? nodes) + { + if (nodes == null || nodes.Count == 0) + { + return new DebugInfoTableNode[0]; + } + + return nodes.Select(MapDebugInfoTableNode).ToArray(); + } + private Manifest MapManifest(CodexOpenApi.ManifestItem manifest) { return new Manifest