Skip to content

Commit 36bc334

Browse files
committed
Fix crash on attempting to frame with @embed filtering.
1 parent aa84596 commit 36bc334

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/JsonLD/Core/JsonLdApi.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1663,9 +1663,14 @@ private static void RemoveDependents(IDictionary<string, JsonLdApi.EmbedNode> em
16631663
, string id)
16641664
{
16651665
// get embed keys as a separate array to enable deleting keys in map
1666-
foreach (string id_dep in embeds.Keys)
1666+
List<string> embedsKeys = new List<string>(embeds.Keys);
1667+
foreach (string id_dep in embedsKeys)
16671668
{
1668-
JsonLdApi.EmbedNode e = embeds[id_dep];
1669+
JsonLdApi.EmbedNode e;
1670+
if (!embeds.TryGetValue(id_dep, out e))
1671+
{
1672+
continue;
1673+
}
16691674
JToken p = !e.parent.IsNull() ? e.parent : new JObject();
16701675
if (!(p is JObject))
16711676
{

0 commit comments

Comments
 (0)